diff --git a/client/.openapi-generator/FILES b/client/.openapi-generator/FILES index 465954c..5f3886f 100644 --- a/client/.openapi-generator/FILES +++ b/client/.openapi-generator/FILES @@ -5,6 +5,7 @@ README.md api/openapi.yaml api_api_tokens.go api_auth.go +api_change_requests.go api_context.go api_environments.go api_projects.go @@ -20,6 +21,9 @@ docs/AdminPermissionsSchemaPermissionsEnvironmentsInner.md docs/ApiTokenSchema.md docs/ApiTokensSchema.md docs/AuthAPI.md +docs/ChangeRequestEnvironmentConfigSchema.md +docs/ChangeRequestsAPI.md +docs/ConstraintSchema.md docs/ContextAPI.md docs/ContextFieldSchema.md docs/CreateApiTokenSchema.md @@ -30,6 +34,7 @@ docs/CreateApiTokenSchemaOneOf3.md docs/CreateContextFieldSchema.md docs/CreateEnvironmentSchema.md docs/CreateFeatureNamingPatternSchema.md +docs/CreateFeatureStrategySchema.md docs/CreatePatSchema.md docs/CreateProjectSchema.md docs/CreateProjectSchemaChangeRequestEnvironmentsInner.md @@ -40,6 +45,8 @@ docs/CreateRoleWithPermissionsSchemaAnyOf1.md docs/CreateRoleWithPermissionsSchemaAnyOf1PermissionsInner.md docs/CreateRoleWithPermissionsSchemaAnyOfPermissionsInner.md docs/CreateServiceAccountSchema.md +docs/CreateStrategyVariantSchema.md +docs/CreateStrategyVariantSchemaPayload.md docs/CreateUserResponseSchema.md docs/CreateUserResponseSchemaRootRole.md docs/CreateUserSchema.md @@ -54,6 +61,7 @@ docs/EdgeUpstreamLatencySchema.md docs/EnvironmentSchema.md docs/EnvironmentsAPI.md docs/EnvironmentsSchema.md +docs/FeatureTypeCountSchema.md docs/GetRoleById404Response.md docs/GetSamlSettings400Response.md docs/GetSamlSettings401Response.md @@ -73,7 +81,13 @@ docs/ProjectAccessConfigurationSchemaRolesInner.md docs/ProjectAccessSchema.md docs/ProjectCreatedSchema.md docs/ProjectCreatedSchemaChangeRequestEnvironmentsInner.md +docs/ProjectEnvironmentSchema.md +docs/ProjectOverviewSchema.md +docs/ProjectOverviewSchemaOnboardingStatus.md +docs/ProjectOverviewSchemaOnboardingStatusOneOf.md +docs/ProjectOverviewSchemaOnboardingStatusOneOf1.md docs/ProjectSchema.md +docs/ProjectStatsSchema.md docs/ProjectsAPI.md docs/ProjectsSchema.md docs/RoleSchema.md @@ -89,6 +103,7 @@ docs/ServiceAccountsAPI.md docs/ServiceAccountsSchema.md docs/SetSamlSettings415Response.md docs/UpdateApiTokenSchema.md +docs/UpdateChangeRequestEnvironmentConfigSchema.md docs/UpdateContextFieldSchema.md docs/UpdateEnvironmentSchema.md docs/UpdateProjectEnterpriseSettingsSchema.md @@ -105,6 +120,8 @@ model_admin_permissions_schema_permissions.go model_admin_permissions_schema_permissions_environments_inner.go model_api_token_schema.go model_api_tokens_schema.go +model_change_request_environment_config_schema.go +model_constraint_schema.go model_context_field_schema.go model_create_api_token_schema.go model_create_api_token_schema_one_of.go @@ -114,6 +131,7 @@ model_create_api_token_schema_one_of_3.go model_create_context_field_schema.go model_create_environment_schema.go model_create_feature_naming_pattern_schema.go +model_create_feature_strategy_schema.go model_create_pat_schema.go model_create_project_schema.go model_create_project_schema_change_request_environments_inner.go @@ -124,6 +142,8 @@ model_create_role_with_permissions_schema_any_of_1.go model_create_role_with_permissions_schema_any_of_1_permissions_inner.go model_create_role_with_permissions_schema_any_of_permissions_inner.go model_create_service_account_schema.go +model_create_strategy_variant_schema.go +model_create_strategy_variant_schema_payload.go model_create_user_response_schema.go model_create_user_response_schema_root_role.go model_create_user_schema.go @@ -137,6 +157,7 @@ model_edge_request_stats_schema.go model_edge_upstream_latency_schema.go model_environment_schema.go model_environments_schema.go +model_feature_type_count_schema.go model_get_role_by_id_404_response.go model_get_saml_settings_400_response.go model_get_saml_settings_401_response.go @@ -156,7 +177,13 @@ model_project_access_configuration_schema_roles_inner.go model_project_access_schema.go model_project_created_schema.go model_project_created_schema_change_request_environments_inner.go +model_project_environment_schema.go +model_project_overview_schema.go +model_project_overview_schema_onboarding_status.go +model_project_overview_schema_onboarding_status_one_of.go +model_project_overview_schema_onboarding_status_one_of_1.go model_project_schema.go +model_project_stats_schema.go model_projects_schema.go model_role_schema.go model_role_with_permissions_schema.go @@ -170,6 +197,7 @@ model_service_account_schema.go model_service_accounts_schema.go model_set_saml_settings_415_response.go model_update_api_token_schema.go +model_update_change_request_environment_config_schema.go model_update_context_field_schema.go model_update_environment_schema.go model_update_project_enterprise_settings_schema.go @@ -181,6 +209,7 @@ model_user_with_project_role_schema.go response.go test/api_api_tokens_test.go test/api_auth_test.go +test/api_change_requests_test.go test/api_context_test.go test/api_environments_test.go test/api_projects_test.go diff --git a/client/README.md b/client/README.md index 57a9336..d3949e8 100644 --- a/client/README.md +++ b/client/README.md @@ -90,6 +90,8 @@ Class | Method | HTTP request | Description *AuthAPI* | [**SetOidcSettings**](docs/AuthAPI.md#setoidcsettings) | **Post** /api/admin/auth/oidc/settings | Set OIDC settings *AuthAPI* | [**SetSamlSettings**](docs/AuthAPI.md#setsamlsettings) | **Post** /api/admin/auth/saml/settings | Update SAML auth settings *AuthAPI* | [**SetSimpleSettings**](docs/AuthAPI.md#setsimplesettings) | **Post** /api/admin/auth/simple/settings | Update Simple auth settings +*ChangeRequestsAPI* | [**GetProjectChangeRequestConfig**](docs/ChangeRequestsAPI.md#getprojectchangerequestconfig) | **Get** /api/admin/projects/{projectId}/change-requests/config | Retrieves change request configuration for a project +*ChangeRequestsAPI* | [**UpdateProjectChangeRequestConfig**](docs/ChangeRequestsAPI.md#updateprojectchangerequestconfig) | **Put** /api/admin/projects/{projectId}/environments/{environment}/change-requests/config | Updates change request configuration for an environment in the project *ContextAPI* | [**CreateContextField**](docs/ContextAPI.md#createcontextfield) | **Post** /api/admin/context | Create a context field *ContextAPI* | [**DeleteContextField**](docs/ContextAPI.md#deletecontextfield) | **Delete** /api/admin/context/{contextField} | Delete an existing context field *ContextAPI* | [**GetContextField**](docs/ContextAPI.md#getcontextfield) | **Get** /api/admin/context/{contextField} | Gets context field @@ -105,6 +107,7 @@ Class | Method | HTTP request | Description *ProjectsAPI* | [**CreateProject**](docs/ProjectsAPI.md#createproject) | **Post** /api/admin/projects | Create project *ProjectsAPI* | [**DeleteProject**](docs/ProjectsAPI.md#deleteproject) | **Delete** /api/admin/projects/{projectId} | Delete project *ProjectsAPI* | [**GetProjectAccess**](docs/ProjectsAPI.md#getprojectaccess) | **Get** /api/admin/projects/{projectId}/access | Get users and groups in project +*ProjectsAPI* | [**GetProjectOverview**](docs/ProjectsAPI.md#getprojectoverview) | **Get** /api/admin/projects/{projectId}/overview | Get an overview of a project. *ProjectsAPI* | [**GetProjects**](docs/ProjectsAPI.md#getprojects) | **Get** /api/admin/projects | Get a list of all projects. *ProjectsAPI* | [**SetProjectAccess**](docs/ProjectsAPI.md#setprojectaccess) | **Put** /api/admin/projects/{projectId}/access | Set users and groups to roles in the current project *ProjectsAPI* | [**UpdateProject**](docs/ProjectsAPI.md#updateproject) | **Put** /api/admin/projects/{projectId} | Update project @@ -135,6 +138,8 @@ Class | Method | HTTP request | Description - [AdminPermissionsSchemaPermissionsEnvironmentsInner](docs/AdminPermissionsSchemaPermissionsEnvironmentsInner.md) - [ApiTokenSchema](docs/ApiTokenSchema.md) - [ApiTokensSchema](docs/ApiTokensSchema.md) + - [ChangeRequestEnvironmentConfigSchema](docs/ChangeRequestEnvironmentConfigSchema.md) + - [ConstraintSchema](docs/ConstraintSchema.md) - [ContextFieldSchema](docs/ContextFieldSchema.md) - [CreateApiTokenSchema](docs/CreateApiTokenSchema.md) - [CreateApiTokenSchemaOneOf](docs/CreateApiTokenSchemaOneOf.md) @@ -144,6 +149,7 @@ Class | Method | HTTP request | Description - [CreateContextFieldSchema](docs/CreateContextFieldSchema.md) - [CreateEnvironmentSchema](docs/CreateEnvironmentSchema.md) - [CreateFeatureNamingPatternSchema](docs/CreateFeatureNamingPatternSchema.md) + - [CreateFeatureStrategySchema](docs/CreateFeatureStrategySchema.md) - [CreatePatSchema](docs/CreatePatSchema.md) - [CreateProjectSchema](docs/CreateProjectSchema.md) - [CreateProjectSchemaChangeRequestEnvironmentsInner](docs/CreateProjectSchemaChangeRequestEnvironmentsInner.md) @@ -154,6 +160,8 @@ Class | Method | HTTP request | Description - [CreateRoleWithPermissionsSchemaAnyOf1PermissionsInner](docs/CreateRoleWithPermissionsSchemaAnyOf1PermissionsInner.md) - [CreateRoleWithPermissionsSchemaAnyOfPermissionsInner](docs/CreateRoleWithPermissionsSchemaAnyOfPermissionsInner.md) - [CreateServiceAccountSchema](docs/CreateServiceAccountSchema.md) + - [CreateStrategyVariantSchema](docs/CreateStrategyVariantSchema.md) + - [CreateStrategyVariantSchemaPayload](docs/CreateStrategyVariantSchemaPayload.md) - [CreateUserResponseSchema](docs/CreateUserResponseSchema.md) - [CreateUserResponseSchemaRootRole](docs/CreateUserResponseSchemaRootRole.md) - [CreateUserSchema](docs/CreateUserSchema.md) @@ -167,6 +175,7 @@ Class | Method | HTTP request | Description - [EdgeUpstreamLatencySchema](docs/EdgeUpstreamLatencySchema.md) - [EnvironmentSchema](docs/EnvironmentSchema.md) - [EnvironmentsSchema](docs/EnvironmentsSchema.md) + - [FeatureTypeCountSchema](docs/FeatureTypeCountSchema.md) - [GetRoleById404Response](docs/GetRoleById404Response.md) - [GetSamlSettings400Response](docs/GetSamlSettings400Response.md) - [GetSamlSettings401Response](docs/GetSamlSettings401Response.md) @@ -186,7 +195,13 @@ Class | Method | HTTP request | Description - [ProjectAccessSchema](docs/ProjectAccessSchema.md) - [ProjectCreatedSchema](docs/ProjectCreatedSchema.md) - [ProjectCreatedSchemaChangeRequestEnvironmentsInner](docs/ProjectCreatedSchemaChangeRequestEnvironmentsInner.md) + - [ProjectEnvironmentSchema](docs/ProjectEnvironmentSchema.md) + - [ProjectOverviewSchema](docs/ProjectOverviewSchema.md) + - [ProjectOverviewSchemaOnboardingStatus](docs/ProjectOverviewSchemaOnboardingStatus.md) + - [ProjectOverviewSchemaOnboardingStatusOneOf](docs/ProjectOverviewSchemaOnboardingStatusOneOf.md) + - [ProjectOverviewSchemaOnboardingStatusOneOf1](docs/ProjectOverviewSchemaOnboardingStatusOneOf1.md) - [ProjectSchema](docs/ProjectSchema.md) + - [ProjectStatsSchema](docs/ProjectStatsSchema.md) - [ProjectsSchema](docs/ProjectsSchema.md) - [RoleSchema](docs/RoleSchema.md) - [RoleWithPermissionsSchema](docs/RoleWithPermissionsSchema.md) @@ -200,6 +215,7 @@ Class | Method | HTTP request | Description - [ServiceAccountsSchema](docs/ServiceAccountsSchema.md) - [SetSamlSettings415Response](docs/SetSamlSettings415Response.md) - [UpdateApiTokenSchema](docs/UpdateApiTokenSchema.md) + - [UpdateChangeRequestEnvironmentConfigSchema](docs/UpdateChangeRequestEnvironmentConfigSchema.md) - [UpdateContextFieldSchema](docs/UpdateContextFieldSchema.md) - [UpdateEnvironmentSchema](docs/UpdateEnvironmentSchema.md) - [UpdateProjectEnterpriseSettingsSchema](docs/UpdateProjectEnterpriseSettingsSchema.md) diff --git a/client/api/openapi.yaml b/client/api/openapi.yaml index bdc9085..02b2cfe 100644 --- a/client/api/openapi.yaml +++ b/client/api/openapi.yaml @@ -736,6 +736,65 @@ paths: summary: Get the environment with `name` tags: - Environments + /api/admin/projects/{projectId}/change-requests/config: + get: + description: "Given a projectId, this endpoint will retrieve change request\ + \ configuration for the project" + operationId: getProjectChangeRequestConfig + parameters: + - explode: false + in: path + name: projectId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/changeRequestConfigSchema' + description: changeRequestConfigSchema + summary: Retrieves change request configuration for a project + tags: + - Change Requests + /api/admin/projects/{projectId}/environments/{environment}/change-requests/config: + put: + description: "This endpoint will change the change request configuration for\ + \ a given environment, set it to either on/off and optionally configure the\ + \ number of approvals needed. The minimum number of approvals is 1 and the\ + \ maximum number is 10. If you provide a number higher than 10 or lower than\ + \ 1, Unleash will clamp it to the allowed range." + operationId: updateProjectChangeRequestConfig + parameters: + - explode: false + in: path + name: projectId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: environment + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/updateChangeRequestEnvironmentConfigSchema' + description: updateChangeRequestEnvironmentConfigSchema + required: true + responses: + "200": + description: This response has no body. + summary: Updates change request configuration for an environment in the project + tags: + - Change Requests /api/admin/service-account: get: description: Returns the list of all service accounts. @@ -1933,6 +1992,50 @@ paths: summary: Update a user tags: - Users + /api/admin/projects/{projectId}/overview: + get: + description: "This endpoint returns an overview of the specified projects stats,\ + \ project health, number of members, which environments are configured, and\ + \ the features types in the project." + operationId: getProjectOverview + parameters: + - explode: false + in: path + name: projectId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/projectOverviewSchema' + description: projectOverviewSchema + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/getSamlSettings_401_response' + description: "Authorization information is missing or invalid. Provide a\ + \ valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getSamlSettings_403_response' + description: "The provided user credentials are valid, but the user does\ + \ not have the necessary permissions to perform this operation" + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getRoleById_404_response' + description: The requested resource was not found. + summary: Get an overview of a project. + tags: + - Projects /api/admin/environments/{name}/on: post: description: Makes it possible to enable this environment for a project. An @@ -2147,6 +2250,68 @@ components: required: - tokens type: object + constraintSchema: + additionalProperties: true + description: "A strategy constraint. For more information, refer to [the strategy\ + \ constraint reference documentation](https://docs.getunleash.io/reference/activation-strategies#constraints)" + properties: + contextName: + description: The name of the context field that this constraint should apply + to. + example: appName + type: string + operator: + description: "The operator to use when evaluating this constraint. For more\ + \ information about the various operators, refer to [the strategy constraint\ + \ operator documentation](https://docs.getunleash.io/reference/activation-strategies#constraint-operators)." + enum: + - NOT_IN + - IN + - STR_ENDS_WITH + - STR_STARTS_WITH + - STR_CONTAINS + - NUM_EQ + - NUM_GT + - NUM_GTE + - NUM_LT + - NUM_LTE + - DATE_AFTER + - DATE_BEFORE + - SEMVER_EQ + - SEMVER_GT + - SEMVER_LT + example: IN + type: string + caseInsensitive: + default: false + description: Whether the operator should be case sensitive or not. Defaults + to `false` (being case sensitive). + type: boolean + inverted: + default: false + description: "Whether the result should be negated or not. If `true`, will\ + \ turn a `true` result into a `false` result and vice versa." + type: boolean + values: + description: The context values that should be used for constraint evaluation. + Use this property instead of `value` for properties that accept multiple + values. + example: + - my-app + - my-other-app + items: + type: string + type: array + value: + description: The context value that should be used for constraint evaluation. + Use this property instead of `values` for properties that only accept + single values. + example: my-app + type: string + required: + - contextName + - operator + type: object contextFieldSchema: additionalProperties: true description: "A representation of a [context field](https://docs.getunleash.io/reference/unleash-context)." @@ -2259,6 +2424,13 @@ components: type: object createFeatureNamingPatternSchema: description: Create a feature naming pattern + example: + pattern: "^[A-Za-z]+\\.[A-Za-z]+\\.[A-Za-z0-9-]+$" + description: |- + .. + + The flag name should contain the project name, the feature name, and the ticket number, each separated by a dot. + example: dx.feature1.1-135 properties: pattern: description: "A JavaScript regular expression pattern, without the start\ @@ -2284,6 +2456,62 @@ components: required: - pattern type: object + createFeatureStrategySchema: + description: Create a strategy configuration in a feature + properties: + name: + description: The name of the strategy type + example: flexibleRollout + type: string + title: + description: A descriptive title for the strategy + example: Gradual Rollout 25-Prod + nullable: true + type: string + disabled: + description: A toggle to disable the strategy. defaults to false. Disabled + strategies are not evaluated or returned to the SDKs + example: false + nullable: true + type: boolean + sortOrder: + description: The order of the strategy in the list + example: 9999 + type: number + constraints: + description: A list of the constraints attached to the strategy. See https://docs.getunleash.io/reference/activation-strategies#constraints + example: + - values: + - "1" + - "2" + inverted: false + operator: IN + contextName: appName + caseInsensitive: false + items: + $ref: '#/components/schemas/constraintSchema' + type: array + variants: + description: Strategy level variants + items: + $ref: '#/components/schemas/createStrategyVariantSchema' + type: array + parameters: + additionalProperties: + type: string + description: A list of parameters for a strategy + type: object + segments: + description: Ids of segments to use for this strategy + example: + - 1 + - 2 + items: + type: number + type: array + required: + - name + type: object createPatSchema: description: "Describes the properties required to create a [personal access\ \ token](https://docs.getunleash.io/reference/api-tokens-and-client-keys#personal-access-tokens),\ @@ -2302,6 +2530,48 @@ components: - description - expiresAt type: object + createStrategyVariantSchema: + description: This is an experimental property. It may change or be removed as + we work on it. Please don't depend on it yet. A strategy variant allows you + to attach any data to strategies instead of only returning `true`/`false`. + Strategy variants take precedence over feature variants. + properties: + name: + description: The variant name. Must be unique for this feature flag + example: blue_group + type: string + weight: + description: "The weight is the likelihood of any one user getting this\ + \ variant. It is an integer between 0 and 1000. See the section on [variant\ + \ weights](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight)\ + \ for more information" + maximum: 1000 + minimum: 0 + type: integer + weightType: + description: "Set to `fix` if this variant must have exactly the weight\ + \ allocated to it. If the type is `variable`, the weight will adjust so\ + \ that the total weight of all variants adds up to 1000. Refer to the\ + \ [variant weight documentation](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight)." + enum: + - variable + - fix + example: fix + type: string + stickiness: + description: "The [stickiness](https://docs.getunleash.io/reference/feature-toggle-variants#variant-stickiness)\ + \ to use for distribution of this variant. Stickiness is how Unleash guarantees\ + \ that the same user gets the same variant every time" + example: custom.context.field + type: string + payload: + $ref: '#/components/schemas/createStrategyVariantSchema_payload' + required: + - name + - stickiness + - weight + - weightType + type: object createUserResponseSchema: additionalProperties: true description: An Unleash user after creation @@ -2539,6 +2809,26 @@ components: - environments - version type: object + featureTypeCountSchema: + additionalProperties: true + description: A count of feature flags of a specific type + example: + count: 1 + type: kill-switch + properties: + type: + description: "Type of the flag e.g. experiment, kill-switch, release, operational,\ + \ permission" + example: kill-switch + type: string + count: + description: Number of feature flags of this type + example: 1 + type: number + required: + - count + - type + type: object groupUserModelSchema: additionalProperties: true description: Details for a single user belonging to a group @@ -2600,6 +2890,11 @@ components: required: - value type: object + parametersSchema: + additionalProperties: + type: string + description: A list of parameters for a strategy + type: object patSchema: description: "Describes a [personal access token](https://docs.getunleash.io/reference/api-tokens-and-client-keys#personal-access-tokens),\ \ or PAT. PATs are automatically scoped to the authenticated user." @@ -2682,6 +2977,173 @@ components: $ref: '#/components/schemas/patSchema' type: array type: object + projectEnvironmentSchema: + additionalProperties: true + description: "Add an environment to a project, optionally also sets if change\ + \ requests are enabled for this environment on the project" + properties: + environment: + description: The environment to add to the project + example: development + type: string + changeRequestsEnabled: + description: Whether change requests should be enabled or for this environment + on the project or not + example: true + type: boolean + defaultStrategy: + $ref: '#/components/schemas/createFeatureStrategySchema' + required: + - environment + type: object + projectOverviewSchema: + additionalProperties: true + description: "A high-level overview of a project. It contains information such\ + \ as project statistics, the name of the project, what members and what features\ + \ it contains, etc." + example: + featureNaming: + pattern: "^[A-Za-z]+\\.[A-Za-z]+\\.[A-Za-z0-9-]+$" + description: |- + .. + + The flag name should contain the project name, the feature name, and the ticket number, each separated by a dot. + example: dx.feature1.1-135 + environments: + - environment: development + - environment: production + defaultStrategy: + name: flexibleRollout + constraints: [] + parameters: + groupId: stickyFlag + rollout: "50" + stickiness: customAppName + featureLimit: 100 + defaultStickiness: userId + description: DX squad feature release + health: 50 + version: 1 + mode: open + archivedAt: 2023-02-10T08:36:35.262Z + createdAt: 2023-02-10T08:36:35.262Z + onboardingStatus: + status: onboarding-started + stats: + archivedCurrentWindow: 5 + projectMembersAddedCurrentWindow: 1 + avgTimeToProdCurrentWindow: 10 + archivedPastWindow: 5 + createdCurrentWindow: 15 + createdPastWindow: 15 + projectActivityCurrentWindow: 100 + projectActivityPastWindow: 100 + members: 4 + name: dx-squad + featureTypeCounts: + - count: 1 + type: kill-switch + - count: 1 + type: kill-switch + favorite: true + updatedAt: 2023-02-10T08:36:35.262Z + properties: + stats: + $ref: '#/components/schemas/projectStatsSchema' + version: + description: The schema version used to describe the project overview + example: 1 + type: integer + name: + description: The name of this project + example: dx-squad + type: string + description: + description: Additional information about the project + example: DX squad feature release + nullable: true + type: string + defaultStickiness: + description: A default stickiness for the project affecting the default + stickiness value for variants and Gradual Rollout strategy + example: userId + type: string + mode: + description: "The project's [collaboration mode](https://docs.getunleash.io/reference/project-collaboration-mode).\ + \ Determines whether non-project members can submit change requests or\ + \ not." + enum: + - open + - protected + - private + example: open + type: string + featureLimit: + description: A limit on the number of features allowed in the project. Null + if no limit. + example: 100 + nullable: true + type: number + featureNaming: + $ref: '#/components/schemas/createFeatureNamingPatternSchema' + members: + description: The number of members this project has + example: 4 + type: number + health: + description: "An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#project-status)\ + \ on a scale from 0 to 100" + example: 50 + type: number + environments: + description: The environments that are enabled for this project + example: + - environment: development + - environment: production + defaultStrategy: + name: flexibleRollout + constraints: [] + parameters: + groupId: stickyFlag + rollout: "50" + stickiness: customAppName + items: + $ref: '#/components/schemas/projectEnvironmentSchema' + type: array + featureTypeCounts: + description: The number of features of each type that are in this project + items: + $ref: '#/components/schemas/featureTypeCountSchema' + type: array + updatedAt: + description: When the project was last updated. + example: 2023-02-10T08:36:35.262Z + format: date-time + nullable: true + type: string + archivedAt: + description: When the project was archived. + example: 2023-02-10T08:36:35.262Z + format: date-time + nullable: true + type: string + createdAt: + description: When the project was created. + example: 2023-02-10T08:36:35.262Z + format: date-time + nullable: true + type: string + favorite: + description: "`true` if the project was favorited, otherwise `false`." + example: true + type: boolean + onboardingStatus: + $ref: '#/components/schemas/projectOverviewSchema_onboardingStatus' + required: + - name + - onboardingStatus + - version + type: object projectSchema: additionalProperties: true description: A definition of the project used for projects listing purposes @@ -2719,6 +3181,72 @@ components: - id - name type: object + projectStatsSchema: + additionalProperties: true + description: |- + Statistics for a project, including the average time to production, number of features created, the project activity and more. + + Stats are divided into current and previous **windows**. + - The **current window** is the past 30 days. + - The **previous window** is the 30 days **before** the current window (from 60 to 30 days ago) + example: + archivedCurrentWindow: 5 + projectMembersAddedCurrentWindow: 1 + avgTimeToProdCurrentWindow: 10 + archivedPastWindow: 5 + createdCurrentWindow: 15 + createdPastWindow: 15 + projectActivityCurrentWindow: 100 + projectActivityPastWindow: 100 + properties: + avgTimeToProdCurrentWindow: + description: The average time from when a feature was created to when it + was enabled in the "production" environment during the current window + example: 10 + type: number + createdCurrentWindow: + description: The number of feature flags created during the current window + example: 15 + type: number + createdPastWindow: + description: The number of feature flags created during the previous window + example: 15 + type: number + archivedCurrentWindow: + description: The number of feature flags that were archived during the current + window + example: 5 + type: number + archivedPastWindow: + description: The number of feature flags that were archived during the previous + window + example: 5 + type: number + projectActivityCurrentWindow: + description: The number of project events that occurred during the current + window + example: 100 + type: number + projectActivityPastWindow: + description: The number of project events that occurred during the previous + window + example: 100 + type: number + projectMembersAddedCurrentWindow: + description: The number of members that were added to the project during + the current window + example: 1 + type: number + required: + - archivedCurrentWindow + - archivedPastWindow + - avgTimeToProdCurrentWindow + - createdCurrentWindow + - createdPastWindow + - projectActivityCurrentWindow + - projectActivityPastWindow + - projectMembersAddedCurrentWindow + type: object projectsSchema: additionalProperties: true description: An overview of all the projects in the Unleash instance @@ -3583,6 +4111,63 @@ components: - $ref: '#/components/schemas/samlSettingsSchema_oneOf' - $ref: '#/components/schemas/samlSettingsSchema_oneOf_1' type: object + changeRequestConfigSchema: + description: "A list of environment-specific [change request](https://docs.getunleash.io/reference/change-requests)\ + \ configurations." + items: + $ref: '#/components/schemas/changeRequestEnvironmentConfigSchema' + type: array + changeRequestEnvironmentConfigSchema: + additionalProperties: true + description: "The [change request](https://docs.getunleash.io/reference/change-requests)\ + \ configuration for a specific environment." + example: + environment: my-dev-environment + changeRequestEnabled: true + requiredApprovals: 2 + type: development + properties: + environment: + description: The environment that this configuration applies to. + example: my-dev-environment + type: string + type: + description: "The [type of the environment](https://docs.getunleash.io/reference/environments#environment-types)\ + \ listed in `environment`." + example: development + type: string + changeRequestEnabled: + description: "`true` if this environment has change requests enabled, otherwise\ + \ `false`." + example: true + type: boolean + requiredApprovals: + description: The number of approvals that are required for a change request + to be fully approved and ready to be applied in this environment. + example: 2 + nullable: true + type: number + required: + - changeRequestEnabled + - environment + - requiredApprovals + - type + type: object + updateChangeRequestEnvironmentConfigSchema: + description: Data used to update change request in an environment + properties: + changeRequestsEnabled: + description: "`true` if change requests should be enabled, otherwise `false`." + type: boolean + requiredApprovals: + description: The number of approvals required before a change request can + be applied in this environment. + example: 3 + minimum: 0 + type: integer + required: + - changeRequestsEnabled + type: object updateEnvironmentSchema: description: "Data used to update an [environment](https://docs.getunleash.io/reference/environments)." properties: @@ -4764,6 +5349,28 @@ components: - type - username type: object + createStrategyVariantSchema_payload: + description: Extra data configured for this variant + example: + type: json + value: "{\"color\": \"red\"}" + properties: + type: + description: "The type of the value. Commonly used types are string, number,\ + \ json and csv." + enum: + - json + - csv + - string + - number + type: string + value: + description: The actual value of payload + type: string + required: + - type + - value + type: object createUserResponseSchema_rootRole: description: "Which [root role](https://docs.getunleash.io/reference/rbac#predefined-roles)\ \ this user is assigned. Usually a numeric role ID, but can be a string when\ @@ -4795,6 +5402,42 @@ components: - Member example: Admin type: string + projectOverviewSchema_onboardingStatus_oneOf: + additionalProperties: true + example: + status: onboarding-started + properties: + status: + enum: + - onboarding-started + - onboarded + example: onboarding-started + type: string + required: + - status + type: object + projectOverviewSchema_onboardingStatus_oneOf_1: + additionalProperties: true + properties: + status: + enum: + - first-flag-created + example: first-flag-created + type: string + feature: + description: The name of the feature flag + example: my-feature-flag + type: string + required: + - feature + - status + type: object + projectOverviewSchema_onboardingStatus: + description: The current onboarding status of the project. + oneOf: + - $ref: '#/components/schemas/projectOverviewSchema_onboardingStatus_oneOf' + - $ref: '#/components/schemas/projectOverviewSchema_onboardingStatus_oneOf_1' + type: object adminPermissionsSchema_permissions_environments_inner: additionalProperties: true example: diff --git a/client/api_change_requests.go b/client/api_change_requests.go new file mode 100644 index 0000000..ecb6be5 --- /dev/null +++ b/client/api_change_requests.go @@ -0,0 +1,263 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// ChangeRequestsAPIService ChangeRequestsAPI service +type ChangeRequestsAPIService service + +type ApiGetProjectChangeRequestConfigRequest struct { + ctx context.Context + ApiService *ChangeRequestsAPIService + projectId string +} + +func (r ApiGetProjectChangeRequestConfigRequest) Execute() ([]ChangeRequestEnvironmentConfigSchema, *http.Response, error) { + return r.ApiService.GetProjectChangeRequestConfigExecute(r) +} + +/* +GetProjectChangeRequestConfig Retrieves change request configuration for a project + +Given a projectId, this endpoint will retrieve change request configuration for the project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiGetProjectChangeRequestConfigRequest +*/ +func (a *ChangeRequestsAPIService) GetProjectChangeRequestConfig(ctx context.Context, projectId string) ApiGetProjectChangeRequestConfigRequest { + return ApiGetProjectChangeRequestConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return []ChangeRequestEnvironmentConfigSchema +func (a *ChangeRequestsAPIService) GetProjectChangeRequestConfigExecute(r ApiGetProjectChangeRequestConfigRequest) ([]ChangeRequestEnvironmentConfigSchema, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ChangeRequestEnvironmentConfigSchema + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChangeRequestsAPIService.GetProjectChangeRequestConfig") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/admin/projects/{projectId}/change-requests/config" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateProjectChangeRequestConfigRequest struct { + ctx context.Context + ApiService *ChangeRequestsAPIService + projectId string + environment string + updateChangeRequestEnvironmentConfigSchema *UpdateChangeRequestEnvironmentConfigSchema +} + +// updateChangeRequestEnvironmentConfigSchema +func (r ApiUpdateProjectChangeRequestConfigRequest) UpdateChangeRequestEnvironmentConfigSchema(updateChangeRequestEnvironmentConfigSchema UpdateChangeRequestEnvironmentConfigSchema) ApiUpdateProjectChangeRequestConfigRequest { + r.updateChangeRequestEnvironmentConfigSchema = &updateChangeRequestEnvironmentConfigSchema + return r +} + +func (r ApiUpdateProjectChangeRequestConfigRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateProjectChangeRequestConfigExecute(r) +} + +/* +UpdateProjectChangeRequestConfig Updates change request configuration for an environment in the project + +This endpoint will change the change request configuration for a given environment, set it to either on/off and optionally configure the number of approvals needed. The minimum number of approvals is 1 and the maximum number is 10. If you provide a number higher than 10 or lower than 1, Unleash will clamp it to the allowed range. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param environment + @return ApiUpdateProjectChangeRequestConfigRequest +*/ +func (a *ChangeRequestsAPIService) UpdateProjectChangeRequestConfig(ctx context.Context, projectId string, environment string) ApiUpdateProjectChangeRequestConfigRequest { + return ApiUpdateProjectChangeRequestConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + environment: environment, + } +} + +// Execute executes the request +func (a *ChangeRequestsAPIService) UpdateProjectChangeRequestConfigExecute(r ApiUpdateProjectChangeRequestConfigRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChangeRequestsAPIService.UpdateProjectChangeRequestConfig") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/admin/projects/{projectId}/environments/{environment}/change-requests/config" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environment"+"}", url.PathEscape(parameterValueToString(r.environment, "environment")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateChangeRequestEnvironmentConfigSchema == nil { + return nil, reportError("updateChangeRequestEnvironmentConfigSchema is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateChangeRequestEnvironmentConfigSchema + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/client/api_projects.go b/client/api_projects.go index 1e06927..4d919d2 100644 --- a/client/api_projects.go +++ b/client/api_projects.go @@ -468,6 +468,156 @@ func (a *ProjectsAPIService) GetProjectAccessExecute(r ApiGetProjectAccessReques return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetProjectOverviewRequest struct { + ctx context.Context + ApiService *ProjectsAPIService + projectId string +} + +func (r ApiGetProjectOverviewRequest) Execute() (*ProjectOverviewSchema, *http.Response, error) { + return r.ApiService.GetProjectOverviewExecute(r) +} + +/* +GetProjectOverview Get an overview of a project. + +This endpoint returns an overview of the specified projects stats, project health, number of members, which environments are configured, and the features types in the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiGetProjectOverviewRequest +*/ +func (a *ProjectsAPIService) GetProjectOverview(ctx context.Context, projectId string) ApiGetProjectOverviewRequest { + return ApiGetProjectOverviewRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ProjectOverviewSchema +func (a *ProjectsAPIService) GetProjectOverviewExecute(r ApiGetProjectOverviewRequest) (*ProjectOverviewSchema, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProjectOverviewSchema + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsAPIService.GetProjectOverview") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/admin/projects/{projectId}/overview" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["apiKey"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v GetSamlSettings401Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GetSamlSettings403Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GetRoleById404Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGetProjectsRequest struct { ctx context.Context ApiService *ProjectsAPIService diff --git a/client/client.go b/client/client.go index 7515e80..47b9754 100644 --- a/client/client.go +++ b/client/client.go @@ -52,6 +52,8 @@ type APIClient struct { AuthAPI *AuthAPIService + ChangeRequestsAPI *ChangeRequestsAPIService + ContextAPI *ContextAPIService EnvironmentsAPI *EnvironmentsAPIService @@ -81,6 +83,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { // API Services c.APITokensAPI = (*APITokensAPIService)(&c.common) c.AuthAPI = (*AuthAPIService)(&c.common) + c.ChangeRequestsAPI = (*ChangeRequestsAPIService)(&c.common) c.ContextAPI = (*ContextAPIService)(&c.common) c.EnvironmentsAPI = (*EnvironmentsAPIService)(&c.common) c.ProjectsAPI = (*ProjectsAPIService)(&c.common) diff --git a/client/docs/ChangeRequestEnvironmentConfigSchema.md b/client/docs/ChangeRequestEnvironmentConfigSchema.md new file mode 100644 index 0000000..b45e340 --- /dev/null +++ b/client/docs/ChangeRequestEnvironmentConfigSchema.md @@ -0,0 +1,124 @@ +# ChangeRequestEnvironmentConfigSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Environment** | **string** | The environment that this configuration applies to. | +**Type** | **string** | The [type of the environment](https://docs.getunleash.io/reference/environments#environment-types) listed in `environment`. | +**ChangeRequestEnabled** | **bool** | `true` if this environment has change requests enabled, otherwise `false`. | +**RequiredApprovals** | **NullableFloat32** | The number of approvals that are required for a change request to be fully approved and ready to be applied in this environment. | + +## Methods + +### NewChangeRequestEnvironmentConfigSchema + +`func NewChangeRequestEnvironmentConfigSchema(environment string, type_ string, changeRequestEnabled bool, requiredApprovals NullableFloat32, ) *ChangeRequestEnvironmentConfigSchema` + +NewChangeRequestEnvironmentConfigSchema instantiates a new ChangeRequestEnvironmentConfigSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChangeRequestEnvironmentConfigSchemaWithDefaults + +`func NewChangeRequestEnvironmentConfigSchemaWithDefaults() *ChangeRequestEnvironmentConfigSchema` + +NewChangeRequestEnvironmentConfigSchemaWithDefaults instantiates a new ChangeRequestEnvironmentConfigSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEnvironment + +`func (o *ChangeRequestEnvironmentConfigSchema) GetEnvironment() string` + +GetEnvironment returns the Environment field if non-nil, zero value otherwise. + +### GetEnvironmentOk + +`func (o *ChangeRequestEnvironmentConfigSchema) GetEnvironmentOk() (*string, bool)` + +GetEnvironmentOk returns a tuple with the Environment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironment + +`func (o *ChangeRequestEnvironmentConfigSchema) SetEnvironment(v string)` + +SetEnvironment sets Environment field to given value. + + +### GetType + +`func (o *ChangeRequestEnvironmentConfigSchema) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ChangeRequestEnvironmentConfigSchema) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ChangeRequestEnvironmentConfigSchema) SetType(v string)` + +SetType sets Type field to given value. + + +### GetChangeRequestEnabled + +`func (o *ChangeRequestEnvironmentConfigSchema) GetChangeRequestEnabled() bool` + +GetChangeRequestEnabled returns the ChangeRequestEnabled field if non-nil, zero value otherwise. + +### GetChangeRequestEnabledOk + +`func (o *ChangeRequestEnvironmentConfigSchema) GetChangeRequestEnabledOk() (*bool, bool)` + +GetChangeRequestEnabledOk returns a tuple with the ChangeRequestEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChangeRequestEnabled + +`func (o *ChangeRequestEnvironmentConfigSchema) SetChangeRequestEnabled(v bool)` + +SetChangeRequestEnabled sets ChangeRequestEnabled field to given value. + + +### GetRequiredApprovals + +`func (o *ChangeRequestEnvironmentConfigSchema) GetRequiredApprovals() float32` + +GetRequiredApprovals returns the RequiredApprovals field if non-nil, zero value otherwise. + +### GetRequiredApprovalsOk + +`func (o *ChangeRequestEnvironmentConfigSchema) GetRequiredApprovalsOk() (*float32, bool)` + +GetRequiredApprovalsOk returns a tuple with the RequiredApprovals field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequiredApprovals + +`func (o *ChangeRequestEnvironmentConfigSchema) SetRequiredApprovals(v float32)` + +SetRequiredApprovals sets RequiredApprovals field to given value. + + +### SetRequiredApprovalsNil + +`func (o *ChangeRequestEnvironmentConfigSchema) SetRequiredApprovalsNil(b bool)` + + SetRequiredApprovalsNil sets the value for RequiredApprovals to be an explicit nil + +### UnsetRequiredApprovals +`func (o *ChangeRequestEnvironmentConfigSchema) UnsetRequiredApprovals()` + +UnsetRequiredApprovals ensures that no value is present for RequiredApprovals, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/ChangeRequestsAPI.md b/client/docs/ChangeRequestsAPI.md new file mode 100644 index 0000000..1158385 --- /dev/null +++ b/client/docs/ChangeRequestsAPI.md @@ -0,0 +1,153 @@ +# \ChangeRequestsAPI + +All URIs are relative to *https://us.app.unleash-hosted.com/ushosted* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetProjectChangeRequestConfig**](ChangeRequestsAPI.md#GetProjectChangeRequestConfig) | **Get** /api/admin/projects/{projectId}/change-requests/config | Retrieves change request configuration for a project +[**UpdateProjectChangeRequestConfig**](ChangeRequestsAPI.md#UpdateProjectChangeRequestConfig) | **Put** /api/admin/projects/{projectId}/environments/{environment}/change-requests/config | Updates change request configuration for an environment in the project + + + +## GetProjectChangeRequestConfig + +> []ChangeRequestEnvironmentConfigSchema GetProjectChangeRequestConfig(ctx, projectId).Execute() + +Retrieves change request configuration for a project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/Unleash/unleash-server-api-go" +) + +func main() { + projectId := "projectId_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChangeRequestsAPI.GetProjectChangeRequestConfig(context.Background(), projectId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChangeRequestsAPI.GetProjectChangeRequestConfig``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetProjectChangeRequestConfig`: []ChangeRequestEnvironmentConfigSchema + fmt.Fprintf(os.Stdout, "Response from `ChangeRequestsAPI.GetProjectChangeRequestConfig`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetProjectChangeRequestConfigRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**[]ChangeRequestEnvironmentConfigSchema**](ChangeRequestEnvironmentConfigSchema.md) + +### Authorization + +[bearerToken](../README.md#bearerToken), [apiKey](../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateProjectChangeRequestConfig + +> UpdateProjectChangeRequestConfig(ctx, projectId, environment).UpdateChangeRequestEnvironmentConfigSchema(updateChangeRequestEnvironmentConfigSchema).Execute() + +Updates change request configuration for an environment in the project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/Unleash/unleash-server-api-go" +) + +func main() { + projectId := "projectId_example" // string | + environment := "environment_example" // string | + updateChangeRequestEnvironmentConfigSchema := *openapiclient.NewUpdateChangeRequestEnvironmentConfigSchema(false) // UpdateChangeRequestEnvironmentConfigSchema | updateChangeRequestEnvironmentConfigSchema + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ChangeRequestsAPI.UpdateProjectChangeRequestConfig(context.Background(), projectId, environment).UpdateChangeRequestEnvironmentConfigSchema(updateChangeRequestEnvironmentConfigSchema).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChangeRequestsAPI.UpdateProjectChangeRequestConfig``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | | +**environment** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateProjectChangeRequestConfigRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **updateChangeRequestEnvironmentConfigSchema** | [**UpdateChangeRequestEnvironmentConfigSchema**](UpdateChangeRequestEnvironmentConfigSchema.md) | updateChangeRequestEnvironmentConfigSchema | + +### Return type + + (empty response body) + +### Authorization + +[bearerToken](../README.md#bearerToken), [apiKey](../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/client/docs/ConstraintSchema.md b/client/docs/ConstraintSchema.md new file mode 100644 index 0000000..af0304f --- /dev/null +++ b/client/docs/ConstraintSchema.md @@ -0,0 +1,176 @@ +# ConstraintSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContextName** | **string** | The name of the context field that this constraint should apply to. | +**Operator** | **string** | The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/reference/activation-strategies#constraint-operators). | +**CaseInsensitive** | Pointer to **bool** | Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive). | [optional] [default to false] +**Inverted** | Pointer to **bool** | Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa. | [optional] [default to false] +**Values** | Pointer to **[]string** | The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values. | [optional] +**Value** | Pointer to **string** | The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values. | [optional] + +## Methods + +### NewConstraintSchema + +`func NewConstraintSchema(contextName string, operator string, ) *ConstraintSchema` + +NewConstraintSchema instantiates a new ConstraintSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConstraintSchemaWithDefaults + +`func NewConstraintSchemaWithDefaults() *ConstraintSchema` + +NewConstraintSchemaWithDefaults instantiates a new ConstraintSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContextName + +`func (o *ConstraintSchema) GetContextName() string` + +GetContextName returns the ContextName field if non-nil, zero value otherwise. + +### GetContextNameOk + +`func (o *ConstraintSchema) GetContextNameOk() (*string, bool)` + +GetContextNameOk returns a tuple with the ContextName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContextName + +`func (o *ConstraintSchema) SetContextName(v string)` + +SetContextName sets ContextName field to given value. + + +### GetOperator + +`func (o *ConstraintSchema) GetOperator() string` + +GetOperator returns the Operator field if non-nil, zero value otherwise. + +### GetOperatorOk + +`func (o *ConstraintSchema) GetOperatorOk() (*string, bool)` + +GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperator + +`func (o *ConstraintSchema) SetOperator(v string)` + +SetOperator sets Operator field to given value. + + +### GetCaseInsensitive + +`func (o *ConstraintSchema) GetCaseInsensitive() bool` + +GetCaseInsensitive returns the CaseInsensitive field if non-nil, zero value otherwise. + +### GetCaseInsensitiveOk + +`func (o *ConstraintSchema) GetCaseInsensitiveOk() (*bool, bool)` + +GetCaseInsensitiveOk returns a tuple with the CaseInsensitive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCaseInsensitive + +`func (o *ConstraintSchema) SetCaseInsensitive(v bool)` + +SetCaseInsensitive sets CaseInsensitive field to given value. + +### HasCaseInsensitive + +`func (o *ConstraintSchema) HasCaseInsensitive() bool` + +HasCaseInsensitive returns a boolean if a field has been set. + +### GetInverted + +`func (o *ConstraintSchema) GetInverted() bool` + +GetInverted returns the Inverted field if non-nil, zero value otherwise. + +### GetInvertedOk + +`func (o *ConstraintSchema) GetInvertedOk() (*bool, bool)` + +GetInvertedOk returns a tuple with the Inverted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInverted + +`func (o *ConstraintSchema) SetInverted(v bool)` + +SetInverted sets Inverted field to given value. + +### HasInverted + +`func (o *ConstraintSchema) HasInverted() bool` + +HasInverted returns a boolean if a field has been set. + +### GetValues + +`func (o *ConstraintSchema) GetValues() []string` + +GetValues returns the Values field if non-nil, zero value otherwise. + +### GetValuesOk + +`func (o *ConstraintSchema) GetValuesOk() (*[]string, bool)` + +GetValuesOk returns a tuple with the Values field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValues + +`func (o *ConstraintSchema) SetValues(v []string)` + +SetValues sets Values field to given value. + +### HasValues + +`func (o *ConstraintSchema) HasValues() bool` + +HasValues returns a boolean if a field has been set. + +### GetValue + +`func (o *ConstraintSchema) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *ConstraintSchema) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *ConstraintSchema) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *ConstraintSchema) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/CreateFeatureStrategySchema.md b/client/docs/CreateFeatureStrategySchema.md new file mode 100644 index 0000000..7b42ec7 --- /dev/null +++ b/client/docs/CreateFeatureStrategySchema.md @@ -0,0 +1,253 @@ +# CreateFeatureStrategySchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the strategy type | +**Title** | Pointer to **NullableString** | A descriptive title for the strategy | [optional] +**Disabled** | Pointer to **NullableBool** | A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs | [optional] +**SortOrder** | Pointer to **float32** | The order of the strategy in the list | [optional] +**Constraints** | Pointer to [**[]ConstraintSchema**](ConstraintSchema.md) | A list of the constraints attached to the strategy. See https://docs.getunleash.io/reference/activation-strategies#constraints | [optional] +**Variants** | Pointer to [**[]CreateStrategyVariantSchema**](CreateStrategyVariantSchema.md) | Strategy level variants | [optional] +**Parameters** | Pointer to **map[string]string** | A list of parameters for a strategy | [optional] +**Segments** | Pointer to **[]float32** | Ids of segments to use for this strategy | [optional] + +## Methods + +### NewCreateFeatureStrategySchema + +`func NewCreateFeatureStrategySchema(name string, ) *CreateFeatureStrategySchema` + +NewCreateFeatureStrategySchema instantiates a new CreateFeatureStrategySchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateFeatureStrategySchemaWithDefaults + +`func NewCreateFeatureStrategySchemaWithDefaults() *CreateFeatureStrategySchema` + +NewCreateFeatureStrategySchemaWithDefaults instantiates a new CreateFeatureStrategySchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *CreateFeatureStrategySchema) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *CreateFeatureStrategySchema) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *CreateFeatureStrategySchema) SetName(v string)` + +SetName sets Name field to given value. + + +### GetTitle + +`func (o *CreateFeatureStrategySchema) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *CreateFeatureStrategySchema) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *CreateFeatureStrategySchema) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *CreateFeatureStrategySchema) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### SetTitleNil + +`func (o *CreateFeatureStrategySchema) SetTitleNil(b bool)` + + SetTitleNil sets the value for Title to be an explicit nil + +### UnsetTitle +`func (o *CreateFeatureStrategySchema) UnsetTitle()` + +UnsetTitle ensures that no value is present for Title, not even an explicit nil +### GetDisabled + +`func (o *CreateFeatureStrategySchema) GetDisabled() bool` + +GetDisabled returns the Disabled field if non-nil, zero value otherwise. + +### GetDisabledOk + +`func (o *CreateFeatureStrategySchema) GetDisabledOk() (*bool, bool)` + +GetDisabledOk returns a tuple with the Disabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisabled + +`func (o *CreateFeatureStrategySchema) SetDisabled(v bool)` + +SetDisabled sets Disabled field to given value. + +### HasDisabled + +`func (o *CreateFeatureStrategySchema) HasDisabled() bool` + +HasDisabled returns a boolean if a field has been set. + +### SetDisabledNil + +`func (o *CreateFeatureStrategySchema) SetDisabledNil(b bool)` + + SetDisabledNil sets the value for Disabled to be an explicit nil + +### UnsetDisabled +`func (o *CreateFeatureStrategySchema) UnsetDisabled()` + +UnsetDisabled ensures that no value is present for Disabled, not even an explicit nil +### GetSortOrder + +`func (o *CreateFeatureStrategySchema) GetSortOrder() float32` + +GetSortOrder returns the SortOrder field if non-nil, zero value otherwise. + +### GetSortOrderOk + +`func (o *CreateFeatureStrategySchema) GetSortOrderOk() (*float32, bool)` + +GetSortOrderOk returns a tuple with the SortOrder field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSortOrder + +`func (o *CreateFeatureStrategySchema) SetSortOrder(v float32)` + +SetSortOrder sets SortOrder field to given value. + +### HasSortOrder + +`func (o *CreateFeatureStrategySchema) HasSortOrder() bool` + +HasSortOrder returns a boolean if a field has been set. + +### GetConstraints + +`func (o *CreateFeatureStrategySchema) GetConstraints() []ConstraintSchema` + +GetConstraints returns the Constraints field if non-nil, zero value otherwise. + +### GetConstraintsOk + +`func (o *CreateFeatureStrategySchema) GetConstraintsOk() (*[]ConstraintSchema, bool)` + +GetConstraintsOk returns a tuple with the Constraints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConstraints + +`func (o *CreateFeatureStrategySchema) SetConstraints(v []ConstraintSchema)` + +SetConstraints sets Constraints field to given value. + +### HasConstraints + +`func (o *CreateFeatureStrategySchema) HasConstraints() bool` + +HasConstraints returns a boolean if a field has been set. + +### GetVariants + +`func (o *CreateFeatureStrategySchema) GetVariants() []CreateStrategyVariantSchema` + +GetVariants returns the Variants field if non-nil, zero value otherwise. + +### GetVariantsOk + +`func (o *CreateFeatureStrategySchema) GetVariantsOk() (*[]CreateStrategyVariantSchema, bool)` + +GetVariantsOk returns a tuple with the Variants field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVariants + +`func (o *CreateFeatureStrategySchema) SetVariants(v []CreateStrategyVariantSchema)` + +SetVariants sets Variants field to given value. + +### HasVariants + +`func (o *CreateFeatureStrategySchema) HasVariants() bool` + +HasVariants returns a boolean if a field has been set. + +### GetParameters + +`func (o *CreateFeatureStrategySchema) GetParameters() map[string]string` + +GetParameters returns the Parameters field if non-nil, zero value otherwise. + +### GetParametersOk + +`func (o *CreateFeatureStrategySchema) GetParametersOk() (*map[string]string, bool)` + +GetParametersOk returns a tuple with the Parameters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParameters + +`func (o *CreateFeatureStrategySchema) SetParameters(v map[string]string)` + +SetParameters sets Parameters field to given value. + +### HasParameters + +`func (o *CreateFeatureStrategySchema) HasParameters() bool` + +HasParameters returns a boolean if a field has been set. + +### GetSegments + +`func (o *CreateFeatureStrategySchema) GetSegments() []float32` + +GetSegments returns the Segments field if non-nil, zero value otherwise. + +### GetSegmentsOk + +`func (o *CreateFeatureStrategySchema) GetSegmentsOk() (*[]float32, bool)` + +GetSegmentsOk returns a tuple with the Segments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSegments + +`func (o *CreateFeatureStrategySchema) SetSegments(v []float32)` + +SetSegments sets Segments field to given value. + +### HasSegments + +`func (o *CreateFeatureStrategySchema) HasSegments() bool` + +HasSegments returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/CreateStrategyVariantSchema.md b/client/docs/CreateStrategyVariantSchema.md new file mode 100644 index 0000000..ccdf3d7 --- /dev/null +++ b/client/docs/CreateStrategyVariantSchema.md @@ -0,0 +1,140 @@ +# CreateStrategyVariantSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The variant name. Must be unique for this feature flag | +**Weight** | **int32** | The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight) for more information | +**WeightType** | **string** | Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight). | +**Stickiness** | **string** | The [stickiness](https://docs.getunleash.io/reference/feature-toggle-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time | +**Payload** | Pointer to [**CreateStrategyVariantSchemaPayload**](CreateStrategyVariantSchemaPayload.md) | | [optional] + +## Methods + +### NewCreateStrategyVariantSchema + +`func NewCreateStrategyVariantSchema(name string, weight int32, weightType string, stickiness string, ) *CreateStrategyVariantSchema` + +NewCreateStrategyVariantSchema instantiates a new CreateStrategyVariantSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateStrategyVariantSchemaWithDefaults + +`func NewCreateStrategyVariantSchemaWithDefaults() *CreateStrategyVariantSchema` + +NewCreateStrategyVariantSchemaWithDefaults instantiates a new CreateStrategyVariantSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *CreateStrategyVariantSchema) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *CreateStrategyVariantSchema) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *CreateStrategyVariantSchema) SetName(v string)` + +SetName sets Name field to given value. + + +### GetWeight + +`func (o *CreateStrategyVariantSchema) GetWeight() int32` + +GetWeight returns the Weight field if non-nil, zero value otherwise. + +### GetWeightOk + +`func (o *CreateStrategyVariantSchema) GetWeightOk() (*int32, bool)` + +GetWeightOk returns a tuple with the Weight field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWeight + +`func (o *CreateStrategyVariantSchema) SetWeight(v int32)` + +SetWeight sets Weight field to given value. + + +### GetWeightType + +`func (o *CreateStrategyVariantSchema) GetWeightType() string` + +GetWeightType returns the WeightType field if non-nil, zero value otherwise. + +### GetWeightTypeOk + +`func (o *CreateStrategyVariantSchema) GetWeightTypeOk() (*string, bool)` + +GetWeightTypeOk returns a tuple with the WeightType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWeightType + +`func (o *CreateStrategyVariantSchema) SetWeightType(v string)` + +SetWeightType sets WeightType field to given value. + + +### GetStickiness + +`func (o *CreateStrategyVariantSchema) GetStickiness() string` + +GetStickiness returns the Stickiness field if non-nil, zero value otherwise. + +### GetStickinessOk + +`func (o *CreateStrategyVariantSchema) GetStickinessOk() (*string, bool)` + +GetStickinessOk returns a tuple with the Stickiness field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStickiness + +`func (o *CreateStrategyVariantSchema) SetStickiness(v string)` + +SetStickiness sets Stickiness field to given value. + + +### GetPayload + +`func (o *CreateStrategyVariantSchema) GetPayload() CreateStrategyVariantSchemaPayload` + +GetPayload returns the Payload field if non-nil, zero value otherwise. + +### GetPayloadOk + +`func (o *CreateStrategyVariantSchema) GetPayloadOk() (*CreateStrategyVariantSchemaPayload, bool)` + +GetPayloadOk returns a tuple with the Payload field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayload + +`func (o *CreateStrategyVariantSchema) SetPayload(v CreateStrategyVariantSchemaPayload)` + +SetPayload sets Payload field to given value. + +### HasPayload + +`func (o *CreateStrategyVariantSchema) HasPayload() bool` + +HasPayload returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/CreateStrategyVariantSchemaPayload.md b/client/docs/CreateStrategyVariantSchemaPayload.md new file mode 100644 index 0000000..02d6c99 --- /dev/null +++ b/client/docs/CreateStrategyVariantSchemaPayload.md @@ -0,0 +1,72 @@ +# CreateStrategyVariantSchemaPayload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of the value. Commonly used types are string, number, json and csv. | +**Value** | **string** | The actual value of payload | + +## Methods + +### NewCreateStrategyVariantSchemaPayload + +`func NewCreateStrategyVariantSchemaPayload(type_ string, value string, ) *CreateStrategyVariantSchemaPayload` + +NewCreateStrategyVariantSchemaPayload instantiates a new CreateStrategyVariantSchemaPayload object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateStrategyVariantSchemaPayloadWithDefaults + +`func NewCreateStrategyVariantSchemaPayloadWithDefaults() *CreateStrategyVariantSchemaPayload` + +NewCreateStrategyVariantSchemaPayloadWithDefaults instantiates a new CreateStrategyVariantSchemaPayload object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *CreateStrategyVariantSchemaPayload) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *CreateStrategyVariantSchemaPayload) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *CreateStrategyVariantSchemaPayload) SetType(v string)` + +SetType sets Type field to given value. + + +### GetValue + +`func (o *CreateStrategyVariantSchemaPayload) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *CreateStrategyVariantSchemaPayload) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *CreateStrategyVariantSchemaPayload) SetValue(v string)` + +SetValue sets Value field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/FeatureTypeCountSchema.md b/client/docs/FeatureTypeCountSchema.md new file mode 100644 index 0000000..5fc901f --- /dev/null +++ b/client/docs/FeatureTypeCountSchema.md @@ -0,0 +1,72 @@ +# FeatureTypeCountSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | Type of the flag e.g. experiment, kill-switch, release, operational, permission | +**Count** | **float32** | Number of feature flags of this type | + +## Methods + +### NewFeatureTypeCountSchema + +`func NewFeatureTypeCountSchema(type_ string, count float32, ) *FeatureTypeCountSchema` + +NewFeatureTypeCountSchema instantiates a new FeatureTypeCountSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFeatureTypeCountSchemaWithDefaults + +`func NewFeatureTypeCountSchemaWithDefaults() *FeatureTypeCountSchema` + +NewFeatureTypeCountSchemaWithDefaults instantiates a new FeatureTypeCountSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *FeatureTypeCountSchema) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *FeatureTypeCountSchema) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *FeatureTypeCountSchema) SetType(v string)` + +SetType sets Type field to given value. + + +### GetCount + +`func (o *FeatureTypeCountSchema) GetCount() float32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *FeatureTypeCountSchema) GetCountOk() (*float32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *FeatureTypeCountSchema) SetCount(v float32)` + +SetCount sets Count field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/ProjectEnvironmentSchema.md b/client/docs/ProjectEnvironmentSchema.md new file mode 100644 index 0000000..7122ed0 --- /dev/null +++ b/client/docs/ProjectEnvironmentSchema.md @@ -0,0 +1,103 @@ +# ProjectEnvironmentSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Environment** | **string** | The environment to add to the project | +**ChangeRequestsEnabled** | Pointer to **bool** | Whether change requests should be enabled or for this environment on the project or not | [optional] +**DefaultStrategy** | Pointer to [**CreateFeatureStrategySchema**](CreateFeatureStrategySchema.md) | | [optional] + +## Methods + +### NewProjectEnvironmentSchema + +`func NewProjectEnvironmentSchema(environment string, ) *ProjectEnvironmentSchema` + +NewProjectEnvironmentSchema instantiates a new ProjectEnvironmentSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectEnvironmentSchemaWithDefaults + +`func NewProjectEnvironmentSchemaWithDefaults() *ProjectEnvironmentSchema` + +NewProjectEnvironmentSchemaWithDefaults instantiates a new ProjectEnvironmentSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEnvironment + +`func (o *ProjectEnvironmentSchema) GetEnvironment() string` + +GetEnvironment returns the Environment field if non-nil, zero value otherwise. + +### GetEnvironmentOk + +`func (o *ProjectEnvironmentSchema) GetEnvironmentOk() (*string, bool)` + +GetEnvironmentOk returns a tuple with the Environment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironment + +`func (o *ProjectEnvironmentSchema) SetEnvironment(v string)` + +SetEnvironment sets Environment field to given value. + + +### GetChangeRequestsEnabled + +`func (o *ProjectEnvironmentSchema) GetChangeRequestsEnabled() bool` + +GetChangeRequestsEnabled returns the ChangeRequestsEnabled field if non-nil, zero value otherwise. + +### GetChangeRequestsEnabledOk + +`func (o *ProjectEnvironmentSchema) GetChangeRequestsEnabledOk() (*bool, bool)` + +GetChangeRequestsEnabledOk returns a tuple with the ChangeRequestsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChangeRequestsEnabled + +`func (o *ProjectEnvironmentSchema) SetChangeRequestsEnabled(v bool)` + +SetChangeRequestsEnabled sets ChangeRequestsEnabled field to given value. + +### HasChangeRequestsEnabled + +`func (o *ProjectEnvironmentSchema) HasChangeRequestsEnabled() bool` + +HasChangeRequestsEnabled returns a boolean if a field has been set. + +### GetDefaultStrategy + +`func (o *ProjectEnvironmentSchema) GetDefaultStrategy() CreateFeatureStrategySchema` + +GetDefaultStrategy returns the DefaultStrategy field if non-nil, zero value otherwise. + +### GetDefaultStrategyOk + +`func (o *ProjectEnvironmentSchema) GetDefaultStrategyOk() (*CreateFeatureStrategySchema, bool)` + +GetDefaultStrategyOk returns a tuple with the DefaultStrategy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultStrategy + +`func (o *ProjectEnvironmentSchema) SetDefaultStrategy(v CreateFeatureStrategySchema)` + +SetDefaultStrategy sets DefaultStrategy field to given value. + +### HasDefaultStrategy + +`func (o *ProjectEnvironmentSchema) HasDefaultStrategy() bool` + +HasDefaultStrategy returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/ProjectOverviewSchema.md b/client/docs/ProjectOverviewSchema.md new file mode 100644 index 0000000..51f0534 --- /dev/null +++ b/client/docs/ProjectOverviewSchema.md @@ -0,0 +1,507 @@ +# ProjectOverviewSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Stats** | Pointer to [**ProjectStatsSchema**](ProjectStatsSchema.md) | | [optional] +**Version** | **int32** | The schema version used to describe the project overview | +**Name** | **string** | The name of this project | +**Description** | Pointer to **NullableString** | Additional information about the project | [optional] +**DefaultStickiness** | Pointer to **string** | A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy | [optional] +**Mode** | Pointer to **string** | The project's [collaboration mode](https://docs.getunleash.io/reference/project-collaboration-mode). Determines whether non-project members can submit change requests or not. | [optional] +**FeatureLimit** | Pointer to **NullableFloat32** | A limit on the number of features allowed in the project. Null if no limit. | [optional] +**FeatureNaming** | Pointer to [**CreateFeatureNamingPatternSchema**](CreateFeatureNamingPatternSchema.md) | | [optional] +**Members** | Pointer to **float32** | The number of members this project has | [optional] +**Health** | Pointer to **float32** | An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100 | [optional] +**Environments** | Pointer to [**[]ProjectEnvironmentSchema**](ProjectEnvironmentSchema.md) | The environments that are enabled for this project | [optional] +**FeatureTypeCounts** | Pointer to [**[]FeatureTypeCountSchema**](FeatureTypeCountSchema.md) | The number of features of each type that are in this project | [optional] +**UpdatedAt** | Pointer to **NullableTime** | When the project was last updated. | [optional] +**ArchivedAt** | Pointer to **NullableTime** | When the project was archived. | [optional] +**CreatedAt** | Pointer to **NullableTime** | When the project was created. | [optional] +**Favorite** | Pointer to **bool** | `true` if the project was favorited, otherwise `false`. | [optional] +**OnboardingStatus** | [**ProjectOverviewSchemaOnboardingStatus**](ProjectOverviewSchemaOnboardingStatus.md) | | + +## Methods + +### NewProjectOverviewSchema + +`func NewProjectOverviewSchema(version int32, name string, onboardingStatus ProjectOverviewSchemaOnboardingStatus, ) *ProjectOverviewSchema` + +NewProjectOverviewSchema instantiates a new ProjectOverviewSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectOverviewSchemaWithDefaults + +`func NewProjectOverviewSchemaWithDefaults() *ProjectOverviewSchema` + +NewProjectOverviewSchemaWithDefaults instantiates a new ProjectOverviewSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStats + +`func (o *ProjectOverviewSchema) GetStats() ProjectStatsSchema` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *ProjectOverviewSchema) GetStatsOk() (*ProjectStatsSchema, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *ProjectOverviewSchema) SetStats(v ProjectStatsSchema)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *ProjectOverviewSchema) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### GetVersion + +`func (o *ProjectOverviewSchema) GetVersion() int32` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *ProjectOverviewSchema) GetVersionOk() (*int32, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *ProjectOverviewSchema) SetVersion(v int32)` + +SetVersion sets Version field to given value. + + +### GetName + +`func (o *ProjectOverviewSchema) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ProjectOverviewSchema) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ProjectOverviewSchema) SetName(v string)` + +SetName sets Name field to given value. + + +### GetDescription + +`func (o *ProjectOverviewSchema) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *ProjectOverviewSchema) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *ProjectOverviewSchema) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *ProjectOverviewSchema) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *ProjectOverviewSchema) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *ProjectOverviewSchema) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetDefaultStickiness + +`func (o *ProjectOverviewSchema) GetDefaultStickiness() string` + +GetDefaultStickiness returns the DefaultStickiness field if non-nil, zero value otherwise. + +### GetDefaultStickinessOk + +`func (o *ProjectOverviewSchema) GetDefaultStickinessOk() (*string, bool)` + +GetDefaultStickinessOk returns a tuple with the DefaultStickiness field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultStickiness + +`func (o *ProjectOverviewSchema) SetDefaultStickiness(v string)` + +SetDefaultStickiness sets DefaultStickiness field to given value. + +### HasDefaultStickiness + +`func (o *ProjectOverviewSchema) HasDefaultStickiness() bool` + +HasDefaultStickiness returns a boolean if a field has been set. + +### GetMode + +`func (o *ProjectOverviewSchema) GetMode() string` + +GetMode returns the Mode field if non-nil, zero value otherwise. + +### GetModeOk + +`func (o *ProjectOverviewSchema) GetModeOk() (*string, bool)` + +GetModeOk returns a tuple with the Mode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMode + +`func (o *ProjectOverviewSchema) SetMode(v string)` + +SetMode sets Mode field to given value. + +### HasMode + +`func (o *ProjectOverviewSchema) HasMode() bool` + +HasMode returns a boolean if a field has been set. + +### GetFeatureLimit + +`func (o *ProjectOverviewSchema) GetFeatureLimit() float32` + +GetFeatureLimit returns the FeatureLimit field if non-nil, zero value otherwise. + +### GetFeatureLimitOk + +`func (o *ProjectOverviewSchema) GetFeatureLimitOk() (*float32, bool)` + +GetFeatureLimitOk returns a tuple with the FeatureLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatureLimit + +`func (o *ProjectOverviewSchema) SetFeatureLimit(v float32)` + +SetFeatureLimit sets FeatureLimit field to given value. + +### HasFeatureLimit + +`func (o *ProjectOverviewSchema) HasFeatureLimit() bool` + +HasFeatureLimit returns a boolean if a field has been set. + +### SetFeatureLimitNil + +`func (o *ProjectOverviewSchema) SetFeatureLimitNil(b bool)` + + SetFeatureLimitNil sets the value for FeatureLimit to be an explicit nil + +### UnsetFeatureLimit +`func (o *ProjectOverviewSchema) UnsetFeatureLimit()` + +UnsetFeatureLimit ensures that no value is present for FeatureLimit, not even an explicit nil +### GetFeatureNaming + +`func (o *ProjectOverviewSchema) GetFeatureNaming() CreateFeatureNamingPatternSchema` + +GetFeatureNaming returns the FeatureNaming field if non-nil, zero value otherwise. + +### GetFeatureNamingOk + +`func (o *ProjectOverviewSchema) GetFeatureNamingOk() (*CreateFeatureNamingPatternSchema, bool)` + +GetFeatureNamingOk returns a tuple with the FeatureNaming field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatureNaming + +`func (o *ProjectOverviewSchema) SetFeatureNaming(v CreateFeatureNamingPatternSchema)` + +SetFeatureNaming sets FeatureNaming field to given value. + +### HasFeatureNaming + +`func (o *ProjectOverviewSchema) HasFeatureNaming() bool` + +HasFeatureNaming returns a boolean if a field has been set. + +### GetMembers + +`func (o *ProjectOverviewSchema) GetMembers() float32` + +GetMembers returns the Members field if non-nil, zero value otherwise. + +### GetMembersOk + +`func (o *ProjectOverviewSchema) GetMembersOk() (*float32, bool)` + +GetMembersOk returns a tuple with the Members field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMembers + +`func (o *ProjectOverviewSchema) SetMembers(v float32)` + +SetMembers sets Members field to given value. + +### HasMembers + +`func (o *ProjectOverviewSchema) HasMembers() bool` + +HasMembers returns a boolean if a field has been set. + +### GetHealth + +`func (o *ProjectOverviewSchema) GetHealth() float32` + +GetHealth returns the Health field if non-nil, zero value otherwise. + +### GetHealthOk + +`func (o *ProjectOverviewSchema) GetHealthOk() (*float32, bool)` + +GetHealthOk returns a tuple with the Health field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHealth + +`func (o *ProjectOverviewSchema) SetHealth(v float32)` + +SetHealth sets Health field to given value. + +### HasHealth + +`func (o *ProjectOverviewSchema) HasHealth() bool` + +HasHealth returns a boolean if a field has been set. + +### GetEnvironments + +`func (o *ProjectOverviewSchema) GetEnvironments() []ProjectEnvironmentSchema` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *ProjectOverviewSchema) GetEnvironmentsOk() (*[]ProjectEnvironmentSchema, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *ProjectOverviewSchema) SetEnvironments(v []ProjectEnvironmentSchema)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *ProjectOverviewSchema) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + +### GetFeatureTypeCounts + +`func (o *ProjectOverviewSchema) GetFeatureTypeCounts() []FeatureTypeCountSchema` + +GetFeatureTypeCounts returns the FeatureTypeCounts field if non-nil, zero value otherwise. + +### GetFeatureTypeCountsOk + +`func (o *ProjectOverviewSchema) GetFeatureTypeCountsOk() (*[]FeatureTypeCountSchema, bool)` + +GetFeatureTypeCountsOk returns a tuple with the FeatureTypeCounts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatureTypeCounts + +`func (o *ProjectOverviewSchema) SetFeatureTypeCounts(v []FeatureTypeCountSchema)` + +SetFeatureTypeCounts sets FeatureTypeCounts field to given value. + +### HasFeatureTypeCounts + +`func (o *ProjectOverviewSchema) HasFeatureTypeCounts() bool` + +HasFeatureTypeCounts returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *ProjectOverviewSchema) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *ProjectOverviewSchema) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *ProjectOverviewSchema) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *ProjectOverviewSchema) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### SetUpdatedAtNil + +`func (o *ProjectOverviewSchema) SetUpdatedAtNil(b bool)` + + SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil + +### UnsetUpdatedAt +`func (o *ProjectOverviewSchema) UnsetUpdatedAt()` + +UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +### GetArchivedAt + +`func (o *ProjectOverviewSchema) GetArchivedAt() time.Time` + +GetArchivedAt returns the ArchivedAt field if non-nil, zero value otherwise. + +### GetArchivedAtOk + +`func (o *ProjectOverviewSchema) GetArchivedAtOk() (*time.Time, bool)` + +GetArchivedAtOk returns a tuple with the ArchivedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArchivedAt + +`func (o *ProjectOverviewSchema) SetArchivedAt(v time.Time)` + +SetArchivedAt sets ArchivedAt field to given value. + +### HasArchivedAt + +`func (o *ProjectOverviewSchema) HasArchivedAt() bool` + +HasArchivedAt returns a boolean if a field has been set. + +### SetArchivedAtNil + +`func (o *ProjectOverviewSchema) SetArchivedAtNil(b bool)` + + SetArchivedAtNil sets the value for ArchivedAt to be an explicit nil + +### UnsetArchivedAt +`func (o *ProjectOverviewSchema) UnsetArchivedAt()` + +UnsetArchivedAt ensures that no value is present for ArchivedAt, not even an explicit nil +### GetCreatedAt + +`func (o *ProjectOverviewSchema) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ProjectOverviewSchema) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ProjectOverviewSchema) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *ProjectOverviewSchema) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### SetCreatedAtNil + +`func (o *ProjectOverviewSchema) SetCreatedAtNil(b bool)` + + SetCreatedAtNil sets the value for CreatedAt to be an explicit nil + +### UnsetCreatedAt +`func (o *ProjectOverviewSchema) UnsetCreatedAt()` + +UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil +### GetFavorite + +`func (o *ProjectOverviewSchema) GetFavorite() bool` + +GetFavorite returns the Favorite field if non-nil, zero value otherwise. + +### GetFavoriteOk + +`func (o *ProjectOverviewSchema) GetFavoriteOk() (*bool, bool)` + +GetFavoriteOk returns a tuple with the Favorite field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFavorite + +`func (o *ProjectOverviewSchema) SetFavorite(v bool)` + +SetFavorite sets Favorite field to given value. + +### HasFavorite + +`func (o *ProjectOverviewSchema) HasFavorite() bool` + +HasFavorite returns a boolean if a field has been set. + +### GetOnboardingStatus + +`func (o *ProjectOverviewSchema) GetOnboardingStatus() ProjectOverviewSchemaOnboardingStatus` + +GetOnboardingStatus returns the OnboardingStatus field if non-nil, zero value otherwise. + +### GetOnboardingStatusOk + +`func (o *ProjectOverviewSchema) GetOnboardingStatusOk() (*ProjectOverviewSchemaOnboardingStatus, bool)` + +GetOnboardingStatusOk returns a tuple with the OnboardingStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOnboardingStatus + +`func (o *ProjectOverviewSchema) SetOnboardingStatus(v ProjectOverviewSchemaOnboardingStatus)` + +SetOnboardingStatus sets OnboardingStatus field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/ProjectOverviewSchemaOnboardingStatus.md b/client/docs/ProjectOverviewSchemaOnboardingStatus.md new file mode 100644 index 0000000..1a82cd0 --- /dev/null +++ b/client/docs/ProjectOverviewSchemaOnboardingStatus.md @@ -0,0 +1,72 @@ +# ProjectOverviewSchemaOnboardingStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | | +**Feature** | **string** | The name of the feature flag | + +## Methods + +### NewProjectOverviewSchemaOnboardingStatus + +`func NewProjectOverviewSchemaOnboardingStatus(status string, feature string, ) *ProjectOverviewSchemaOnboardingStatus` + +NewProjectOverviewSchemaOnboardingStatus instantiates a new ProjectOverviewSchemaOnboardingStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectOverviewSchemaOnboardingStatusWithDefaults + +`func NewProjectOverviewSchemaOnboardingStatusWithDefaults() *ProjectOverviewSchemaOnboardingStatus` + +NewProjectOverviewSchemaOnboardingStatusWithDefaults instantiates a new ProjectOverviewSchemaOnboardingStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *ProjectOverviewSchemaOnboardingStatus) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *ProjectOverviewSchemaOnboardingStatus) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *ProjectOverviewSchemaOnboardingStatus) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetFeature + +`func (o *ProjectOverviewSchemaOnboardingStatus) GetFeature() string` + +GetFeature returns the Feature field if non-nil, zero value otherwise. + +### GetFeatureOk + +`func (o *ProjectOverviewSchemaOnboardingStatus) GetFeatureOk() (*string, bool)` + +GetFeatureOk returns a tuple with the Feature field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeature + +`func (o *ProjectOverviewSchemaOnboardingStatus) SetFeature(v string)` + +SetFeature sets Feature field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/ProjectOverviewSchemaOnboardingStatusOneOf.md b/client/docs/ProjectOverviewSchemaOnboardingStatusOneOf.md new file mode 100644 index 0000000..bc10f1b --- /dev/null +++ b/client/docs/ProjectOverviewSchemaOnboardingStatusOneOf.md @@ -0,0 +1,51 @@ +# ProjectOverviewSchemaOnboardingStatusOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | | + +## Methods + +### NewProjectOverviewSchemaOnboardingStatusOneOf + +`func NewProjectOverviewSchemaOnboardingStatusOneOf(status string, ) *ProjectOverviewSchemaOnboardingStatusOneOf` + +NewProjectOverviewSchemaOnboardingStatusOneOf instantiates a new ProjectOverviewSchemaOnboardingStatusOneOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectOverviewSchemaOnboardingStatusOneOfWithDefaults + +`func NewProjectOverviewSchemaOnboardingStatusOneOfWithDefaults() *ProjectOverviewSchemaOnboardingStatusOneOf` + +NewProjectOverviewSchemaOnboardingStatusOneOfWithDefaults instantiates a new ProjectOverviewSchemaOnboardingStatusOneOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf) SetStatus(v string)` + +SetStatus sets Status field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/ProjectOverviewSchemaOnboardingStatusOneOf1.md b/client/docs/ProjectOverviewSchemaOnboardingStatusOneOf1.md new file mode 100644 index 0000000..c8f4979 --- /dev/null +++ b/client/docs/ProjectOverviewSchemaOnboardingStatusOneOf1.md @@ -0,0 +1,72 @@ +# ProjectOverviewSchemaOnboardingStatusOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | | +**Feature** | **string** | The name of the feature flag | + +## Methods + +### NewProjectOverviewSchemaOnboardingStatusOneOf1 + +`func NewProjectOverviewSchemaOnboardingStatusOneOf1(status string, feature string, ) *ProjectOverviewSchemaOnboardingStatusOneOf1` + +NewProjectOverviewSchemaOnboardingStatusOneOf1 instantiates a new ProjectOverviewSchemaOnboardingStatusOneOf1 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectOverviewSchemaOnboardingStatusOneOf1WithDefaults + +`func NewProjectOverviewSchemaOnboardingStatusOneOf1WithDefaults() *ProjectOverviewSchemaOnboardingStatusOneOf1` + +NewProjectOverviewSchemaOnboardingStatusOneOf1WithDefaults instantiates a new ProjectOverviewSchemaOnboardingStatusOneOf1 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetFeature + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) GetFeature() string` + +GetFeature returns the Feature field if non-nil, zero value otherwise. + +### GetFeatureOk + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) GetFeatureOk() (*string, bool)` + +GetFeatureOk returns a tuple with the Feature field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeature + +`func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) SetFeature(v string)` + +SetFeature sets Feature field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/ProjectStatsSchema.md b/client/docs/ProjectStatsSchema.md new file mode 100644 index 0000000..7e1edf1 --- /dev/null +++ b/client/docs/ProjectStatsSchema.md @@ -0,0 +1,198 @@ +# ProjectStatsSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvgTimeToProdCurrentWindow** | **float32** | The average time from when a feature was created to when it was enabled in the \"production\" environment during the current window | +**CreatedCurrentWindow** | **float32** | The number of feature flags created during the current window | +**CreatedPastWindow** | **float32** | The number of feature flags created during the previous window | +**ArchivedCurrentWindow** | **float32** | The number of feature flags that were archived during the current window | +**ArchivedPastWindow** | **float32** | The number of feature flags that were archived during the previous window | +**ProjectActivityCurrentWindow** | **float32** | The number of project events that occurred during the current window | +**ProjectActivityPastWindow** | **float32** | The number of project events that occurred during the previous window | +**ProjectMembersAddedCurrentWindow** | **float32** | The number of members that were added to the project during the current window | + +## Methods + +### NewProjectStatsSchema + +`func NewProjectStatsSchema(avgTimeToProdCurrentWindow float32, createdCurrentWindow float32, createdPastWindow float32, archivedCurrentWindow float32, archivedPastWindow float32, projectActivityCurrentWindow float32, projectActivityPastWindow float32, projectMembersAddedCurrentWindow float32, ) *ProjectStatsSchema` + +NewProjectStatsSchema instantiates a new ProjectStatsSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectStatsSchemaWithDefaults + +`func NewProjectStatsSchemaWithDefaults() *ProjectStatsSchema` + +NewProjectStatsSchemaWithDefaults instantiates a new ProjectStatsSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvgTimeToProdCurrentWindow + +`func (o *ProjectStatsSchema) GetAvgTimeToProdCurrentWindow() float32` + +GetAvgTimeToProdCurrentWindow returns the AvgTimeToProdCurrentWindow field if non-nil, zero value otherwise. + +### GetAvgTimeToProdCurrentWindowOk + +`func (o *ProjectStatsSchema) GetAvgTimeToProdCurrentWindowOk() (*float32, bool)` + +GetAvgTimeToProdCurrentWindowOk returns a tuple with the AvgTimeToProdCurrentWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvgTimeToProdCurrentWindow + +`func (o *ProjectStatsSchema) SetAvgTimeToProdCurrentWindow(v float32)` + +SetAvgTimeToProdCurrentWindow sets AvgTimeToProdCurrentWindow field to given value. + + +### GetCreatedCurrentWindow + +`func (o *ProjectStatsSchema) GetCreatedCurrentWindow() float32` + +GetCreatedCurrentWindow returns the CreatedCurrentWindow field if non-nil, zero value otherwise. + +### GetCreatedCurrentWindowOk + +`func (o *ProjectStatsSchema) GetCreatedCurrentWindowOk() (*float32, bool)` + +GetCreatedCurrentWindowOk returns a tuple with the CreatedCurrentWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedCurrentWindow + +`func (o *ProjectStatsSchema) SetCreatedCurrentWindow(v float32)` + +SetCreatedCurrentWindow sets CreatedCurrentWindow field to given value. + + +### GetCreatedPastWindow + +`func (o *ProjectStatsSchema) GetCreatedPastWindow() float32` + +GetCreatedPastWindow returns the CreatedPastWindow field if non-nil, zero value otherwise. + +### GetCreatedPastWindowOk + +`func (o *ProjectStatsSchema) GetCreatedPastWindowOk() (*float32, bool)` + +GetCreatedPastWindowOk returns a tuple with the CreatedPastWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedPastWindow + +`func (o *ProjectStatsSchema) SetCreatedPastWindow(v float32)` + +SetCreatedPastWindow sets CreatedPastWindow field to given value. + + +### GetArchivedCurrentWindow + +`func (o *ProjectStatsSchema) GetArchivedCurrentWindow() float32` + +GetArchivedCurrentWindow returns the ArchivedCurrentWindow field if non-nil, zero value otherwise. + +### GetArchivedCurrentWindowOk + +`func (o *ProjectStatsSchema) GetArchivedCurrentWindowOk() (*float32, bool)` + +GetArchivedCurrentWindowOk returns a tuple with the ArchivedCurrentWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArchivedCurrentWindow + +`func (o *ProjectStatsSchema) SetArchivedCurrentWindow(v float32)` + +SetArchivedCurrentWindow sets ArchivedCurrentWindow field to given value. + + +### GetArchivedPastWindow + +`func (o *ProjectStatsSchema) GetArchivedPastWindow() float32` + +GetArchivedPastWindow returns the ArchivedPastWindow field if non-nil, zero value otherwise. + +### GetArchivedPastWindowOk + +`func (o *ProjectStatsSchema) GetArchivedPastWindowOk() (*float32, bool)` + +GetArchivedPastWindowOk returns a tuple with the ArchivedPastWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArchivedPastWindow + +`func (o *ProjectStatsSchema) SetArchivedPastWindow(v float32)` + +SetArchivedPastWindow sets ArchivedPastWindow field to given value. + + +### GetProjectActivityCurrentWindow + +`func (o *ProjectStatsSchema) GetProjectActivityCurrentWindow() float32` + +GetProjectActivityCurrentWindow returns the ProjectActivityCurrentWindow field if non-nil, zero value otherwise. + +### GetProjectActivityCurrentWindowOk + +`func (o *ProjectStatsSchema) GetProjectActivityCurrentWindowOk() (*float32, bool)` + +GetProjectActivityCurrentWindowOk returns a tuple with the ProjectActivityCurrentWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectActivityCurrentWindow + +`func (o *ProjectStatsSchema) SetProjectActivityCurrentWindow(v float32)` + +SetProjectActivityCurrentWindow sets ProjectActivityCurrentWindow field to given value. + + +### GetProjectActivityPastWindow + +`func (o *ProjectStatsSchema) GetProjectActivityPastWindow() float32` + +GetProjectActivityPastWindow returns the ProjectActivityPastWindow field if non-nil, zero value otherwise. + +### GetProjectActivityPastWindowOk + +`func (o *ProjectStatsSchema) GetProjectActivityPastWindowOk() (*float32, bool)` + +GetProjectActivityPastWindowOk returns a tuple with the ProjectActivityPastWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectActivityPastWindow + +`func (o *ProjectStatsSchema) SetProjectActivityPastWindow(v float32)` + +SetProjectActivityPastWindow sets ProjectActivityPastWindow field to given value. + + +### GetProjectMembersAddedCurrentWindow + +`func (o *ProjectStatsSchema) GetProjectMembersAddedCurrentWindow() float32` + +GetProjectMembersAddedCurrentWindow returns the ProjectMembersAddedCurrentWindow field if non-nil, zero value otherwise. + +### GetProjectMembersAddedCurrentWindowOk + +`func (o *ProjectStatsSchema) GetProjectMembersAddedCurrentWindowOk() (*float32, bool)` + +GetProjectMembersAddedCurrentWindowOk returns a tuple with the ProjectMembersAddedCurrentWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectMembersAddedCurrentWindow + +`func (o *ProjectStatsSchema) SetProjectMembersAddedCurrentWindow(v float32)` + +SetProjectMembersAddedCurrentWindow sets ProjectMembersAddedCurrentWindow field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/docs/ProjectsAPI.md b/client/docs/ProjectsAPI.md index a24f01a..f59a651 100644 --- a/client/docs/ProjectsAPI.md +++ b/client/docs/ProjectsAPI.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**CreateProject**](ProjectsAPI.md#CreateProject) | **Post** /api/admin/projects | Create project [**DeleteProject**](ProjectsAPI.md#DeleteProject) | **Delete** /api/admin/projects/{projectId} | Delete project [**GetProjectAccess**](ProjectsAPI.md#GetProjectAccess) | **Get** /api/admin/projects/{projectId}/access | Get users and groups in project +[**GetProjectOverview**](ProjectsAPI.md#GetProjectOverview) | **Get** /api/admin/projects/{projectId}/overview | Get an overview of a project. [**GetProjects**](ProjectsAPI.md#GetProjects) | **Get** /api/admin/projects | Get a list of all projects. [**SetProjectAccess**](ProjectsAPI.md#SetProjectAccess) | **Put** /api/admin/projects/{projectId}/access | Set users and groups to roles in the current project [**UpdateProject**](ProjectsAPI.md#UpdateProject) | **Put** /api/admin/projects/{projectId} | Update project @@ -218,6 +219,76 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## GetProjectOverview + +> ProjectOverviewSchema GetProjectOverview(ctx, projectId).Execute() + +Get an overview of a project. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/Unleash/unleash-server-api-go" +) + +func main() { + projectId := "projectId_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsAPI.GetProjectOverview(context.Background(), projectId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsAPI.GetProjectOverview``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetProjectOverview`: ProjectOverviewSchema + fmt.Fprintf(os.Stdout, "Response from `ProjectsAPI.GetProjectOverview`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetProjectOverviewRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ProjectOverviewSchema**](ProjectOverviewSchema.md) + +### Authorization + +[bearerToken](../README.md#bearerToken), [apiKey](../README.md#apiKey) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## GetProjects > ProjectsSchema GetProjects(ctx).Archived(archived).Execute() diff --git a/client/docs/UpdateChangeRequestEnvironmentConfigSchema.md b/client/docs/UpdateChangeRequestEnvironmentConfigSchema.md new file mode 100644 index 0000000..67f6911 --- /dev/null +++ b/client/docs/UpdateChangeRequestEnvironmentConfigSchema.md @@ -0,0 +1,77 @@ +# UpdateChangeRequestEnvironmentConfigSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ChangeRequestsEnabled** | **bool** | `true` if change requests should be enabled, otherwise `false`. | +**RequiredApprovals** | Pointer to **int32** | The number of approvals required before a change request can be applied in this environment. | [optional] + +## Methods + +### NewUpdateChangeRequestEnvironmentConfigSchema + +`func NewUpdateChangeRequestEnvironmentConfigSchema(changeRequestsEnabled bool, ) *UpdateChangeRequestEnvironmentConfigSchema` + +NewUpdateChangeRequestEnvironmentConfigSchema instantiates a new UpdateChangeRequestEnvironmentConfigSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateChangeRequestEnvironmentConfigSchemaWithDefaults + +`func NewUpdateChangeRequestEnvironmentConfigSchemaWithDefaults() *UpdateChangeRequestEnvironmentConfigSchema` + +NewUpdateChangeRequestEnvironmentConfigSchemaWithDefaults instantiates a new UpdateChangeRequestEnvironmentConfigSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChangeRequestsEnabled + +`func (o *UpdateChangeRequestEnvironmentConfigSchema) GetChangeRequestsEnabled() bool` + +GetChangeRequestsEnabled returns the ChangeRequestsEnabled field if non-nil, zero value otherwise. + +### GetChangeRequestsEnabledOk + +`func (o *UpdateChangeRequestEnvironmentConfigSchema) GetChangeRequestsEnabledOk() (*bool, bool)` + +GetChangeRequestsEnabledOk returns a tuple with the ChangeRequestsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChangeRequestsEnabled + +`func (o *UpdateChangeRequestEnvironmentConfigSchema) SetChangeRequestsEnabled(v bool)` + +SetChangeRequestsEnabled sets ChangeRequestsEnabled field to given value. + + +### GetRequiredApprovals + +`func (o *UpdateChangeRequestEnvironmentConfigSchema) GetRequiredApprovals() int32` + +GetRequiredApprovals returns the RequiredApprovals field if non-nil, zero value otherwise. + +### GetRequiredApprovalsOk + +`func (o *UpdateChangeRequestEnvironmentConfigSchema) GetRequiredApprovalsOk() (*int32, bool)` + +GetRequiredApprovalsOk returns a tuple with the RequiredApprovals field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequiredApprovals + +`func (o *UpdateChangeRequestEnvironmentConfigSchema) SetRequiredApprovals(v int32)` + +SetRequiredApprovals sets RequiredApprovals field to given value. + +### HasRequiredApprovals + +`func (o *UpdateChangeRequestEnvironmentConfigSchema) HasRequiredApprovals() bool` + +HasRequiredApprovals returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/client/model_change_request_environment_config_schema.go b/client/model_change_request_environment_config_schema.go new file mode 100644 index 0000000..9b4eea8 --- /dev/null +++ b/client/model_change_request_environment_config_schema.go @@ -0,0 +1,259 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the ChangeRequestEnvironmentConfigSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ChangeRequestEnvironmentConfigSchema{} + +// ChangeRequestEnvironmentConfigSchema The [change request](https://docs.getunleash.io/reference/change-requests) configuration for a specific environment. +type ChangeRequestEnvironmentConfigSchema struct { + // The environment that this configuration applies to. + Environment string `json:"environment"` + // The [type of the environment](https://docs.getunleash.io/reference/environments#environment-types) listed in `environment`. + Type string `json:"type"` + // `true` if this environment has change requests enabled, otherwise `false`. + ChangeRequestEnabled bool `json:"changeRequestEnabled"` + // The number of approvals that are required for a change request to be fully approved and ready to be applied in this environment. + RequiredApprovals NullableFloat32 `json:"requiredApprovals"` + AdditionalProperties map[string]interface{} +} + +type _ChangeRequestEnvironmentConfigSchema ChangeRequestEnvironmentConfigSchema + +// NewChangeRequestEnvironmentConfigSchema instantiates a new ChangeRequestEnvironmentConfigSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChangeRequestEnvironmentConfigSchema(environment string, type_ string, changeRequestEnabled bool, requiredApprovals NullableFloat32) *ChangeRequestEnvironmentConfigSchema { + this := ChangeRequestEnvironmentConfigSchema{} + this.Environment = environment + this.Type = type_ + this.ChangeRequestEnabled = changeRequestEnabled + this.RequiredApprovals = requiredApprovals + return &this +} + +// NewChangeRequestEnvironmentConfigSchemaWithDefaults instantiates a new ChangeRequestEnvironmentConfigSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChangeRequestEnvironmentConfigSchemaWithDefaults() *ChangeRequestEnvironmentConfigSchema { + this := ChangeRequestEnvironmentConfigSchema{} + return &this +} + +// GetEnvironment returns the Environment field value +func (o *ChangeRequestEnvironmentConfigSchema) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *ChangeRequestEnvironmentConfigSchema) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *ChangeRequestEnvironmentConfigSchema) SetEnvironment(v string) { + o.Environment = v +} + +// GetType returns the Type field value +func (o *ChangeRequestEnvironmentConfigSchema) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ChangeRequestEnvironmentConfigSchema) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ChangeRequestEnvironmentConfigSchema) SetType(v string) { + o.Type = v +} + +// GetChangeRequestEnabled returns the ChangeRequestEnabled field value +func (o *ChangeRequestEnvironmentConfigSchema) GetChangeRequestEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.ChangeRequestEnabled +} + +// GetChangeRequestEnabledOk returns a tuple with the ChangeRequestEnabled field value +// and a boolean to check if the value has been set. +func (o *ChangeRequestEnvironmentConfigSchema) GetChangeRequestEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ChangeRequestEnabled, true +} + +// SetChangeRequestEnabled sets field value +func (o *ChangeRequestEnvironmentConfigSchema) SetChangeRequestEnabled(v bool) { + o.ChangeRequestEnabled = v +} + +// GetRequiredApprovals returns the RequiredApprovals field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *ChangeRequestEnvironmentConfigSchema) GetRequiredApprovals() float32 { + if o == nil || o.RequiredApprovals.Get() == nil { + var ret float32 + return ret + } + + return *o.RequiredApprovals.Get() +} + +// GetRequiredApprovalsOk returns a tuple with the RequiredApprovals field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ChangeRequestEnvironmentConfigSchema) GetRequiredApprovalsOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.RequiredApprovals.Get(), o.RequiredApprovals.IsSet() +} + +// SetRequiredApprovals sets field value +func (o *ChangeRequestEnvironmentConfigSchema) SetRequiredApprovals(v float32) { + o.RequiredApprovals.Set(&v) +} + +func (o ChangeRequestEnvironmentConfigSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChangeRequestEnvironmentConfigSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["environment"] = o.Environment + toSerialize["type"] = o.Type + toSerialize["changeRequestEnabled"] = o.ChangeRequestEnabled + toSerialize["requiredApprovals"] = o.RequiredApprovals.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ChangeRequestEnvironmentConfigSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "environment", + "type", + "changeRequestEnabled", + "requiredApprovals", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varChangeRequestEnvironmentConfigSchema := _ChangeRequestEnvironmentConfigSchema{} + + err = json.Unmarshal(data, &varChangeRequestEnvironmentConfigSchema) + + if err != nil { + return err + } + + *o = ChangeRequestEnvironmentConfigSchema(varChangeRequestEnvironmentConfigSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "environment") + delete(additionalProperties, "type") + delete(additionalProperties, "changeRequestEnabled") + delete(additionalProperties, "requiredApprovals") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableChangeRequestEnvironmentConfigSchema struct { + value *ChangeRequestEnvironmentConfigSchema + isSet bool +} + +func (v NullableChangeRequestEnvironmentConfigSchema) Get() *ChangeRequestEnvironmentConfigSchema { + return v.value +} + +func (v *NullableChangeRequestEnvironmentConfigSchema) Set(val *ChangeRequestEnvironmentConfigSchema) { + v.value = val + v.isSet = true +} + +func (v NullableChangeRequestEnvironmentConfigSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableChangeRequestEnvironmentConfigSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChangeRequestEnvironmentConfigSchema(val *ChangeRequestEnvironmentConfigSchema) *NullableChangeRequestEnvironmentConfigSchema { + return &NullableChangeRequestEnvironmentConfigSchema{value: val, isSet: true} +} + +func (v NullableChangeRequestEnvironmentConfigSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChangeRequestEnvironmentConfigSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_constraint_schema.go b/client/model_constraint_schema.go new file mode 100644 index 0000000..b6aaa41 --- /dev/null +++ b/client/model_constraint_schema.go @@ -0,0 +1,357 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConstraintSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConstraintSchema{} + +// ConstraintSchema A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/activation-strategies#constraints) +type ConstraintSchema struct { + // The name of the context field that this constraint should apply to. + ContextName string `json:"contextName"` + // The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/reference/activation-strategies#constraint-operators). + Operator string `json:"operator"` + // Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive). + CaseInsensitive *bool `json:"caseInsensitive,omitempty"` + // Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa. + Inverted *bool `json:"inverted,omitempty"` + // The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values. + Values []string `json:"values,omitempty"` + // The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values. + Value *string `json:"value,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConstraintSchema ConstraintSchema + +// NewConstraintSchema instantiates a new ConstraintSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConstraintSchema(contextName string, operator string) *ConstraintSchema { + this := ConstraintSchema{} + this.ContextName = contextName + this.Operator = operator + var caseInsensitive bool = false + this.CaseInsensitive = &caseInsensitive + var inverted bool = false + this.Inverted = &inverted + return &this +} + +// NewConstraintSchemaWithDefaults instantiates a new ConstraintSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConstraintSchemaWithDefaults() *ConstraintSchema { + this := ConstraintSchema{} + var caseInsensitive bool = false + this.CaseInsensitive = &caseInsensitive + var inverted bool = false + this.Inverted = &inverted + return &this +} + +// GetContextName returns the ContextName field value +func (o *ConstraintSchema) GetContextName() string { + if o == nil { + var ret string + return ret + } + + return o.ContextName +} + +// GetContextNameOk returns a tuple with the ContextName field value +// and a boolean to check if the value has been set. +func (o *ConstraintSchema) GetContextNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContextName, true +} + +// SetContextName sets field value +func (o *ConstraintSchema) SetContextName(v string) { + o.ContextName = v +} + +// GetOperator returns the Operator field value +func (o *ConstraintSchema) GetOperator() string { + if o == nil { + var ret string + return ret + } + + return o.Operator +} + +// GetOperatorOk returns a tuple with the Operator field value +// and a boolean to check if the value has been set. +func (o *ConstraintSchema) GetOperatorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operator, true +} + +// SetOperator sets field value +func (o *ConstraintSchema) SetOperator(v string) { + o.Operator = v +} + +// GetCaseInsensitive returns the CaseInsensitive field value if set, zero value otherwise. +func (o *ConstraintSchema) GetCaseInsensitive() bool { + if o == nil || IsNil(o.CaseInsensitive) { + var ret bool + return ret + } + return *o.CaseInsensitive +} + +// GetCaseInsensitiveOk returns a tuple with the CaseInsensitive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConstraintSchema) GetCaseInsensitiveOk() (*bool, bool) { + if o == nil || IsNil(o.CaseInsensitive) { + return nil, false + } + return o.CaseInsensitive, true +} + +// HasCaseInsensitive returns a boolean if a field has been set. +func (o *ConstraintSchema) HasCaseInsensitive() bool { + if o != nil && !IsNil(o.CaseInsensitive) { + return true + } + + return false +} + +// SetCaseInsensitive gets a reference to the given bool and assigns it to the CaseInsensitive field. +func (o *ConstraintSchema) SetCaseInsensitive(v bool) { + o.CaseInsensitive = &v +} + +// GetInverted returns the Inverted field value if set, zero value otherwise. +func (o *ConstraintSchema) GetInverted() bool { + if o == nil || IsNil(o.Inverted) { + var ret bool + return ret + } + return *o.Inverted +} + +// GetInvertedOk returns a tuple with the Inverted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConstraintSchema) GetInvertedOk() (*bool, bool) { + if o == nil || IsNil(o.Inverted) { + return nil, false + } + return o.Inverted, true +} + +// HasInverted returns a boolean if a field has been set. +func (o *ConstraintSchema) HasInverted() bool { + if o != nil && !IsNil(o.Inverted) { + return true + } + + return false +} + +// SetInverted gets a reference to the given bool and assigns it to the Inverted field. +func (o *ConstraintSchema) SetInverted(v bool) { + o.Inverted = &v +} + +// GetValues returns the Values field value if set, zero value otherwise. +func (o *ConstraintSchema) GetValues() []string { + if o == nil || IsNil(o.Values) { + var ret []string + return ret + } + return o.Values +} + +// GetValuesOk returns a tuple with the Values field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConstraintSchema) GetValuesOk() ([]string, bool) { + if o == nil || IsNil(o.Values) { + return nil, false + } + return o.Values, true +} + +// HasValues returns a boolean if a field has been set. +func (o *ConstraintSchema) HasValues() bool { + if o != nil && !IsNil(o.Values) { + return true + } + + return false +} + +// SetValues gets a reference to the given []string and assigns it to the Values field. +func (o *ConstraintSchema) SetValues(v []string) { + o.Values = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ConstraintSchema) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConstraintSchema) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ConstraintSchema) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *ConstraintSchema) SetValue(v string) { + o.Value = &v +} + +func (o ConstraintSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConstraintSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contextName"] = o.ContextName + toSerialize["operator"] = o.Operator + if !IsNil(o.CaseInsensitive) { + toSerialize["caseInsensitive"] = o.CaseInsensitive + } + if !IsNil(o.Inverted) { + toSerialize["inverted"] = o.Inverted + } + if !IsNil(o.Values) { + toSerialize["values"] = o.Values + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConstraintSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "contextName", + "operator", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConstraintSchema := _ConstraintSchema{} + + err = json.Unmarshal(data, &varConstraintSchema) + + if err != nil { + return err + } + + *o = ConstraintSchema(varConstraintSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "contextName") + delete(additionalProperties, "operator") + delete(additionalProperties, "caseInsensitive") + delete(additionalProperties, "inverted") + delete(additionalProperties, "values") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConstraintSchema struct { + value *ConstraintSchema + isSet bool +} + +func (v NullableConstraintSchema) Get() *ConstraintSchema { + return v.value +} + +func (v *NullableConstraintSchema) Set(val *ConstraintSchema) { + v.value = val + v.isSet = true +} + +func (v NullableConstraintSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableConstraintSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConstraintSchema(val *ConstraintSchema) *NullableConstraintSchema { + return &NullableConstraintSchema{value: val, isSet: true} +} + +func (v NullableConstraintSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConstraintSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_create_feature_strategy_schema.go b/client/model_create_feature_strategy_schema.go new file mode 100644 index 0000000..b9379f6 --- /dev/null +++ b/client/model_create_feature_strategy_schema.go @@ -0,0 +1,455 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateFeatureStrategySchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateFeatureStrategySchema{} + +// CreateFeatureStrategySchema Create a strategy configuration in a feature +type CreateFeatureStrategySchema struct { + // The name of the strategy type + Name string `json:"name"` + // A descriptive title for the strategy + Title NullableString `json:"title,omitempty"` + // A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs + Disabled NullableBool `json:"disabled,omitempty"` + // The order of the strategy in the list + SortOrder *float32 `json:"sortOrder,omitempty"` + // A list of the constraints attached to the strategy. See https://docs.getunleash.io/reference/activation-strategies#constraints + Constraints []ConstraintSchema `json:"constraints,omitempty"` + // Strategy level variants + Variants []CreateStrategyVariantSchema `json:"variants,omitempty"` + // A list of parameters for a strategy + Parameters *map[string]string `json:"parameters,omitempty"` + // Ids of segments to use for this strategy + Segments []float32 `json:"segments,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateFeatureStrategySchema CreateFeatureStrategySchema + +// NewCreateFeatureStrategySchema instantiates a new CreateFeatureStrategySchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateFeatureStrategySchema(name string) *CreateFeatureStrategySchema { + this := CreateFeatureStrategySchema{} + this.Name = name + return &this +} + +// NewCreateFeatureStrategySchemaWithDefaults instantiates a new CreateFeatureStrategySchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateFeatureStrategySchemaWithDefaults() *CreateFeatureStrategySchema { + this := CreateFeatureStrategySchema{} + return &this +} + +// GetName returns the Name field value +func (o *CreateFeatureStrategySchema) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateFeatureStrategySchema) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateFeatureStrategySchema) SetName(v string) { + o.Name = v +} + +// GetTitle returns the Title field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateFeatureStrategySchema) GetTitle() string { + if o == nil || IsNil(o.Title.Get()) { + var ret string + return ret + } + return *o.Title.Get() +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateFeatureStrategySchema) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Title.Get(), o.Title.IsSet() +} + +// HasTitle returns a boolean if a field has been set. +func (o *CreateFeatureStrategySchema) HasTitle() bool { + if o != nil && o.Title.IsSet() { + return true + } + + return false +} + +// SetTitle gets a reference to the given NullableString and assigns it to the Title field. +func (o *CreateFeatureStrategySchema) SetTitle(v string) { + o.Title.Set(&v) +} + +// SetTitleNil sets the value for Title to be an explicit nil +func (o *CreateFeatureStrategySchema) SetTitleNil() { + o.Title.Set(nil) +} + +// UnsetTitle ensures that no value is present for Title, not even an explicit nil +func (o *CreateFeatureStrategySchema) UnsetTitle() { + o.Title.Unset() +} + +// GetDisabled returns the Disabled field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateFeatureStrategySchema) GetDisabled() bool { + if o == nil || IsNil(o.Disabled.Get()) { + var ret bool + return ret + } + return *o.Disabled.Get() +} + +// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateFeatureStrategySchema) GetDisabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.Disabled.Get(), o.Disabled.IsSet() +} + +// HasDisabled returns a boolean if a field has been set. +func (o *CreateFeatureStrategySchema) HasDisabled() bool { + if o != nil && o.Disabled.IsSet() { + return true + } + + return false +} + +// SetDisabled gets a reference to the given NullableBool and assigns it to the Disabled field. +func (o *CreateFeatureStrategySchema) SetDisabled(v bool) { + o.Disabled.Set(&v) +} + +// SetDisabledNil sets the value for Disabled to be an explicit nil +func (o *CreateFeatureStrategySchema) SetDisabledNil() { + o.Disabled.Set(nil) +} + +// UnsetDisabled ensures that no value is present for Disabled, not even an explicit nil +func (o *CreateFeatureStrategySchema) UnsetDisabled() { + o.Disabled.Unset() +} + +// GetSortOrder returns the SortOrder field value if set, zero value otherwise. +func (o *CreateFeatureStrategySchema) GetSortOrder() float32 { + if o == nil || IsNil(o.SortOrder) { + var ret float32 + return ret + } + return *o.SortOrder +} + +// GetSortOrderOk returns a tuple with the SortOrder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateFeatureStrategySchema) GetSortOrderOk() (*float32, bool) { + if o == nil || IsNil(o.SortOrder) { + return nil, false + } + return o.SortOrder, true +} + +// HasSortOrder returns a boolean if a field has been set. +func (o *CreateFeatureStrategySchema) HasSortOrder() bool { + if o != nil && !IsNil(o.SortOrder) { + return true + } + + return false +} + +// SetSortOrder gets a reference to the given float32 and assigns it to the SortOrder field. +func (o *CreateFeatureStrategySchema) SetSortOrder(v float32) { + o.SortOrder = &v +} + +// GetConstraints returns the Constraints field value if set, zero value otherwise. +func (o *CreateFeatureStrategySchema) GetConstraints() []ConstraintSchema { + if o == nil || IsNil(o.Constraints) { + var ret []ConstraintSchema + return ret + } + return o.Constraints +} + +// GetConstraintsOk returns a tuple with the Constraints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateFeatureStrategySchema) GetConstraintsOk() ([]ConstraintSchema, bool) { + if o == nil || IsNil(o.Constraints) { + return nil, false + } + return o.Constraints, true +} + +// HasConstraints returns a boolean if a field has been set. +func (o *CreateFeatureStrategySchema) HasConstraints() bool { + if o != nil && !IsNil(o.Constraints) { + return true + } + + return false +} + +// SetConstraints gets a reference to the given []ConstraintSchema and assigns it to the Constraints field. +func (o *CreateFeatureStrategySchema) SetConstraints(v []ConstraintSchema) { + o.Constraints = v +} + +// GetVariants returns the Variants field value if set, zero value otherwise. +func (o *CreateFeatureStrategySchema) GetVariants() []CreateStrategyVariantSchema { + if o == nil || IsNil(o.Variants) { + var ret []CreateStrategyVariantSchema + return ret + } + return o.Variants +} + +// GetVariantsOk returns a tuple with the Variants field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateFeatureStrategySchema) GetVariantsOk() ([]CreateStrategyVariantSchema, bool) { + if o == nil || IsNil(o.Variants) { + return nil, false + } + return o.Variants, true +} + +// HasVariants returns a boolean if a field has been set. +func (o *CreateFeatureStrategySchema) HasVariants() bool { + if o != nil && !IsNil(o.Variants) { + return true + } + + return false +} + +// SetVariants gets a reference to the given []CreateStrategyVariantSchema and assigns it to the Variants field. +func (o *CreateFeatureStrategySchema) SetVariants(v []CreateStrategyVariantSchema) { + o.Variants = v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateFeatureStrategySchema) GetParameters() map[string]string { + if o == nil || IsNil(o.Parameters) { + var ret map[string]string + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateFeatureStrategySchema) GetParametersOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateFeatureStrategySchema) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]string and assigns it to the Parameters field. +func (o *CreateFeatureStrategySchema) SetParameters(v map[string]string) { + o.Parameters = &v +} + +// GetSegments returns the Segments field value if set, zero value otherwise. +func (o *CreateFeatureStrategySchema) GetSegments() []float32 { + if o == nil || IsNil(o.Segments) { + var ret []float32 + return ret + } + return o.Segments +} + +// GetSegmentsOk returns a tuple with the Segments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateFeatureStrategySchema) GetSegmentsOk() ([]float32, bool) { + if o == nil || IsNil(o.Segments) { + return nil, false + } + return o.Segments, true +} + +// HasSegments returns a boolean if a field has been set. +func (o *CreateFeatureStrategySchema) HasSegments() bool { + if o != nil && !IsNil(o.Segments) { + return true + } + + return false +} + +// SetSegments gets a reference to the given []float32 and assigns it to the Segments field. +func (o *CreateFeatureStrategySchema) SetSegments(v []float32) { + o.Segments = v +} + +func (o CreateFeatureStrategySchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateFeatureStrategySchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Title.IsSet() { + toSerialize["title"] = o.Title.Get() + } + if o.Disabled.IsSet() { + toSerialize["disabled"] = o.Disabled.Get() + } + if !IsNil(o.SortOrder) { + toSerialize["sortOrder"] = o.SortOrder + } + if !IsNil(o.Constraints) { + toSerialize["constraints"] = o.Constraints + } + if !IsNil(o.Variants) { + toSerialize["variants"] = o.Variants + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.Segments) { + toSerialize["segments"] = o.Segments + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateFeatureStrategySchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateFeatureStrategySchema := _CreateFeatureStrategySchema{} + + err = json.Unmarshal(data, &varCreateFeatureStrategySchema) + + if err != nil { + return err + } + + *o = CreateFeatureStrategySchema(varCreateFeatureStrategySchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "title") + delete(additionalProperties, "disabled") + delete(additionalProperties, "sortOrder") + delete(additionalProperties, "constraints") + delete(additionalProperties, "variants") + delete(additionalProperties, "parameters") + delete(additionalProperties, "segments") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateFeatureStrategySchema struct { + value *CreateFeatureStrategySchema + isSet bool +} + +func (v NullableCreateFeatureStrategySchema) Get() *CreateFeatureStrategySchema { + return v.value +} + +func (v *NullableCreateFeatureStrategySchema) Set(val *CreateFeatureStrategySchema) { + v.value = val + v.isSet = true +} + +func (v NullableCreateFeatureStrategySchema) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateFeatureStrategySchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateFeatureStrategySchema(val *CreateFeatureStrategySchema) *NullableCreateFeatureStrategySchema { + return &NullableCreateFeatureStrategySchema{value: val, isSet: true} +} + +func (v NullableCreateFeatureStrategySchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateFeatureStrategySchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_create_strategy_variant_schema.go b/client/model_create_strategy_variant_schema.go new file mode 100644 index 0000000..052a3fa --- /dev/null +++ b/client/model_create_strategy_variant_schema.go @@ -0,0 +1,294 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateStrategyVariantSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateStrategyVariantSchema{} + +// CreateStrategyVariantSchema This is an experimental property. It may change or be removed as we work on it. Please don't depend on it yet. A strategy variant allows you to attach any data to strategies instead of only returning `true`/`false`. Strategy variants take precedence over feature variants. +type CreateStrategyVariantSchema struct { + // The variant name. Must be unique for this feature flag + Name string `json:"name"` + // The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight) for more information + Weight int32 `json:"weight"` + // Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight). + WeightType string `json:"weightType"` + // The [stickiness](https://docs.getunleash.io/reference/feature-toggle-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time + Stickiness string `json:"stickiness"` + Payload *CreateStrategyVariantSchemaPayload `json:"payload,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateStrategyVariantSchema CreateStrategyVariantSchema + +// NewCreateStrategyVariantSchema instantiates a new CreateStrategyVariantSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateStrategyVariantSchema(name string, weight int32, weightType string, stickiness string) *CreateStrategyVariantSchema { + this := CreateStrategyVariantSchema{} + this.Name = name + this.Weight = weight + this.WeightType = weightType + this.Stickiness = stickiness + return &this +} + +// NewCreateStrategyVariantSchemaWithDefaults instantiates a new CreateStrategyVariantSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateStrategyVariantSchemaWithDefaults() *CreateStrategyVariantSchema { + this := CreateStrategyVariantSchema{} + return &this +} + +// GetName returns the Name field value +func (o *CreateStrategyVariantSchema) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateStrategyVariantSchema) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateStrategyVariantSchema) SetName(v string) { + o.Name = v +} + +// GetWeight returns the Weight field value +func (o *CreateStrategyVariantSchema) GetWeight() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value +// and a boolean to check if the value has been set. +func (o *CreateStrategyVariantSchema) GetWeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Weight, true +} + +// SetWeight sets field value +func (o *CreateStrategyVariantSchema) SetWeight(v int32) { + o.Weight = v +} + +// GetWeightType returns the WeightType field value +func (o *CreateStrategyVariantSchema) GetWeightType() string { + if o == nil { + var ret string + return ret + } + + return o.WeightType +} + +// GetWeightTypeOk returns a tuple with the WeightType field value +// and a boolean to check if the value has been set. +func (o *CreateStrategyVariantSchema) GetWeightTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.WeightType, true +} + +// SetWeightType sets field value +func (o *CreateStrategyVariantSchema) SetWeightType(v string) { + o.WeightType = v +} + +// GetStickiness returns the Stickiness field value +func (o *CreateStrategyVariantSchema) GetStickiness() string { + if o == nil { + var ret string + return ret + } + + return o.Stickiness +} + +// GetStickinessOk returns a tuple with the Stickiness field value +// and a boolean to check if the value has been set. +func (o *CreateStrategyVariantSchema) GetStickinessOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Stickiness, true +} + +// SetStickiness sets field value +func (o *CreateStrategyVariantSchema) SetStickiness(v string) { + o.Stickiness = v +} + +// GetPayload returns the Payload field value if set, zero value otherwise. +func (o *CreateStrategyVariantSchema) GetPayload() CreateStrategyVariantSchemaPayload { + if o == nil || IsNil(o.Payload) { + var ret CreateStrategyVariantSchemaPayload + return ret + } + return *o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateStrategyVariantSchema) GetPayloadOk() (*CreateStrategyVariantSchemaPayload, bool) { + if o == nil || IsNil(o.Payload) { + return nil, false + } + return o.Payload, true +} + +// HasPayload returns a boolean if a field has been set. +func (o *CreateStrategyVariantSchema) HasPayload() bool { + if o != nil && !IsNil(o.Payload) { + return true + } + + return false +} + +// SetPayload gets a reference to the given CreateStrategyVariantSchemaPayload and assigns it to the Payload field. +func (o *CreateStrategyVariantSchema) SetPayload(v CreateStrategyVariantSchemaPayload) { + o.Payload = &v +} + +func (o CreateStrategyVariantSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateStrategyVariantSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["weight"] = o.Weight + toSerialize["weightType"] = o.WeightType + toSerialize["stickiness"] = o.Stickiness + if !IsNil(o.Payload) { + toSerialize["payload"] = o.Payload + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateStrategyVariantSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "weight", + "weightType", + "stickiness", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateStrategyVariantSchema := _CreateStrategyVariantSchema{} + + err = json.Unmarshal(data, &varCreateStrategyVariantSchema) + + if err != nil { + return err + } + + *o = CreateStrategyVariantSchema(varCreateStrategyVariantSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "weight") + delete(additionalProperties, "weightType") + delete(additionalProperties, "stickiness") + delete(additionalProperties, "payload") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateStrategyVariantSchema struct { + value *CreateStrategyVariantSchema + isSet bool +} + +func (v NullableCreateStrategyVariantSchema) Get() *CreateStrategyVariantSchema { + return v.value +} + +func (v *NullableCreateStrategyVariantSchema) Set(val *CreateStrategyVariantSchema) { + v.value = val + v.isSet = true +} + +func (v NullableCreateStrategyVariantSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateStrategyVariantSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateStrategyVariantSchema(val *CreateStrategyVariantSchema) *NullableCreateStrategyVariantSchema { + return &NullableCreateStrategyVariantSchema{value: val, isSet: true} +} + +func (v NullableCreateStrategyVariantSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateStrategyVariantSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_create_strategy_variant_schema_payload.go b/client/model_create_strategy_variant_schema_payload.go new file mode 100644 index 0000000..ac80d24 --- /dev/null +++ b/client/model_create_strategy_variant_schema_payload.go @@ -0,0 +1,197 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateStrategyVariantSchemaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateStrategyVariantSchemaPayload{} + +// CreateStrategyVariantSchemaPayload Extra data configured for this variant +type CreateStrategyVariantSchemaPayload struct { + // The type of the value. Commonly used types are string, number, json and csv. + Type string `json:"type"` + // The actual value of payload + Value string `json:"value"` + AdditionalProperties map[string]interface{} +} + +type _CreateStrategyVariantSchemaPayload CreateStrategyVariantSchemaPayload + +// NewCreateStrategyVariantSchemaPayload instantiates a new CreateStrategyVariantSchemaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateStrategyVariantSchemaPayload(type_ string, value string) *CreateStrategyVariantSchemaPayload { + this := CreateStrategyVariantSchemaPayload{} + this.Type = type_ + this.Value = value + return &this +} + +// NewCreateStrategyVariantSchemaPayloadWithDefaults instantiates a new CreateStrategyVariantSchemaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateStrategyVariantSchemaPayloadWithDefaults() *CreateStrategyVariantSchemaPayload { + this := CreateStrategyVariantSchemaPayload{} + return &this +} + +// GetType returns the Type field value +func (o *CreateStrategyVariantSchemaPayload) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CreateStrategyVariantSchemaPayload) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CreateStrategyVariantSchemaPayload) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *CreateStrategyVariantSchemaPayload) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *CreateStrategyVariantSchemaPayload) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *CreateStrategyVariantSchemaPayload) SetValue(v string) { + o.Value = v +} + +func (o CreateStrategyVariantSchemaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateStrategyVariantSchemaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateStrategyVariantSchemaPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateStrategyVariantSchemaPayload := _CreateStrategyVariantSchemaPayload{} + + err = json.Unmarshal(data, &varCreateStrategyVariantSchemaPayload) + + if err != nil { + return err + } + + *o = CreateStrategyVariantSchemaPayload(varCreateStrategyVariantSchemaPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateStrategyVariantSchemaPayload struct { + value *CreateStrategyVariantSchemaPayload + isSet bool +} + +func (v NullableCreateStrategyVariantSchemaPayload) Get() *CreateStrategyVariantSchemaPayload { + return v.value +} + +func (v *NullableCreateStrategyVariantSchemaPayload) Set(val *CreateStrategyVariantSchemaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateStrategyVariantSchemaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateStrategyVariantSchemaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateStrategyVariantSchemaPayload(val *CreateStrategyVariantSchemaPayload) *NullableCreateStrategyVariantSchemaPayload { + return &NullableCreateStrategyVariantSchemaPayload{value: val, isSet: true} +} + +func (v NullableCreateStrategyVariantSchemaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateStrategyVariantSchemaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_feature_type_count_schema.go b/client/model_feature_type_count_schema.go new file mode 100644 index 0000000..4d99be8 --- /dev/null +++ b/client/model_feature_type_count_schema.go @@ -0,0 +1,197 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the FeatureTypeCountSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FeatureTypeCountSchema{} + +// FeatureTypeCountSchema A count of feature flags of a specific type +type FeatureTypeCountSchema struct { + // Type of the flag e.g. experiment, kill-switch, release, operational, permission + Type string `json:"type"` + // Number of feature flags of this type + Count float32 `json:"count"` + AdditionalProperties map[string]interface{} +} + +type _FeatureTypeCountSchema FeatureTypeCountSchema + +// NewFeatureTypeCountSchema instantiates a new FeatureTypeCountSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFeatureTypeCountSchema(type_ string, count float32) *FeatureTypeCountSchema { + this := FeatureTypeCountSchema{} + this.Type = type_ + this.Count = count + return &this +} + +// NewFeatureTypeCountSchemaWithDefaults instantiates a new FeatureTypeCountSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFeatureTypeCountSchemaWithDefaults() *FeatureTypeCountSchema { + this := FeatureTypeCountSchema{} + return &this +} + +// GetType returns the Type field value +func (o *FeatureTypeCountSchema) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *FeatureTypeCountSchema) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *FeatureTypeCountSchema) SetType(v string) { + o.Type = v +} + +// GetCount returns the Count field value +func (o *FeatureTypeCountSchema) GetCount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *FeatureTypeCountSchema) GetCountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *FeatureTypeCountSchema) SetCount(v float32) { + o.Count = v +} + +func (o FeatureTypeCountSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FeatureTypeCountSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["count"] = o.Count + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FeatureTypeCountSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFeatureTypeCountSchema := _FeatureTypeCountSchema{} + + err = json.Unmarshal(data, &varFeatureTypeCountSchema) + + if err != nil { + return err + } + + *o = FeatureTypeCountSchema(varFeatureTypeCountSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFeatureTypeCountSchema struct { + value *FeatureTypeCountSchema + isSet bool +} + +func (v NullableFeatureTypeCountSchema) Get() *FeatureTypeCountSchema { + return v.value +} + +func (v *NullableFeatureTypeCountSchema) Set(val *FeatureTypeCountSchema) { + v.value = val + v.isSet = true +} + +func (v NullableFeatureTypeCountSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableFeatureTypeCountSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFeatureTypeCountSchema(val *FeatureTypeCountSchema) *NullableFeatureTypeCountSchema { + return &NullableFeatureTypeCountSchema{value: val, isSet: true} +} + +func (v NullableFeatureTypeCountSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFeatureTypeCountSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_project_environment_schema.go b/client/model_project_environment_schema.go new file mode 100644 index 0000000..3c5742f --- /dev/null +++ b/client/model_project_environment_schema.go @@ -0,0 +1,242 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProjectEnvironmentSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectEnvironmentSchema{} + +// ProjectEnvironmentSchema Add an environment to a project, optionally also sets if change requests are enabled for this environment on the project +type ProjectEnvironmentSchema struct { + // The environment to add to the project + Environment string `json:"environment"` + // Whether change requests should be enabled or for this environment on the project or not + ChangeRequestsEnabled *bool `json:"changeRequestsEnabled,omitempty"` + DefaultStrategy *CreateFeatureStrategySchema `json:"defaultStrategy,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProjectEnvironmentSchema ProjectEnvironmentSchema + +// NewProjectEnvironmentSchema instantiates a new ProjectEnvironmentSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectEnvironmentSchema(environment string) *ProjectEnvironmentSchema { + this := ProjectEnvironmentSchema{} + this.Environment = environment + return &this +} + +// NewProjectEnvironmentSchemaWithDefaults instantiates a new ProjectEnvironmentSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectEnvironmentSchemaWithDefaults() *ProjectEnvironmentSchema { + this := ProjectEnvironmentSchema{} + return &this +} + +// GetEnvironment returns the Environment field value +func (o *ProjectEnvironmentSchema) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *ProjectEnvironmentSchema) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *ProjectEnvironmentSchema) SetEnvironment(v string) { + o.Environment = v +} + +// GetChangeRequestsEnabled returns the ChangeRequestsEnabled field value if set, zero value otherwise. +func (o *ProjectEnvironmentSchema) GetChangeRequestsEnabled() bool { + if o == nil || IsNil(o.ChangeRequestsEnabled) { + var ret bool + return ret + } + return *o.ChangeRequestsEnabled +} + +// GetChangeRequestsEnabledOk returns a tuple with the ChangeRequestsEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectEnvironmentSchema) GetChangeRequestsEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.ChangeRequestsEnabled) { + return nil, false + } + return o.ChangeRequestsEnabled, true +} + +// HasChangeRequestsEnabled returns a boolean if a field has been set. +func (o *ProjectEnvironmentSchema) HasChangeRequestsEnabled() bool { + if o != nil && !IsNil(o.ChangeRequestsEnabled) { + return true + } + + return false +} + +// SetChangeRequestsEnabled gets a reference to the given bool and assigns it to the ChangeRequestsEnabled field. +func (o *ProjectEnvironmentSchema) SetChangeRequestsEnabled(v bool) { + o.ChangeRequestsEnabled = &v +} + +// GetDefaultStrategy returns the DefaultStrategy field value if set, zero value otherwise. +func (o *ProjectEnvironmentSchema) GetDefaultStrategy() CreateFeatureStrategySchema { + if o == nil || IsNil(o.DefaultStrategy) { + var ret CreateFeatureStrategySchema + return ret + } + return *o.DefaultStrategy +} + +// GetDefaultStrategyOk returns a tuple with the DefaultStrategy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectEnvironmentSchema) GetDefaultStrategyOk() (*CreateFeatureStrategySchema, bool) { + if o == nil || IsNil(o.DefaultStrategy) { + return nil, false + } + return o.DefaultStrategy, true +} + +// HasDefaultStrategy returns a boolean if a field has been set. +func (o *ProjectEnvironmentSchema) HasDefaultStrategy() bool { + if o != nil && !IsNil(o.DefaultStrategy) { + return true + } + + return false +} + +// SetDefaultStrategy gets a reference to the given CreateFeatureStrategySchema and assigns it to the DefaultStrategy field. +func (o *ProjectEnvironmentSchema) SetDefaultStrategy(v CreateFeatureStrategySchema) { + o.DefaultStrategy = &v +} + +func (o ProjectEnvironmentSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectEnvironmentSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["environment"] = o.Environment + if !IsNil(o.ChangeRequestsEnabled) { + toSerialize["changeRequestsEnabled"] = o.ChangeRequestsEnabled + } + if !IsNil(o.DefaultStrategy) { + toSerialize["defaultStrategy"] = o.DefaultStrategy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectEnvironmentSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "environment", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectEnvironmentSchema := _ProjectEnvironmentSchema{} + + err = json.Unmarshal(data, &varProjectEnvironmentSchema) + + if err != nil { + return err + } + + *o = ProjectEnvironmentSchema(varProjectEnvironmentSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "environment") + delete(additionalProperties, "changeRequestsEnabled") + delete(additionalProperties, "defaultStrategy") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectEnvironmentSchema struct { + value *ProjectEnvironmentSchema + isSet bool +} + +func (v NullableProjectEnvironmentSchema) Get() *ProjectEnvironmentSchema { + return v.value +} + +func (v *NullableProjectEnvironmentSchema) Set(val *ProjectEnvironmentSchema) { + v.value = val + v.isSet = true +} + +func (v NullableProjectEnvironmentSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectEnvironmentSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectEnvironmentSchema(val *ProjectEnvironmentSchema) *NullableProjectEnvironmentSchema { + return &NullableProjectEnvironmentSchema{value: val, isSet: true} +} + +func (v NullableProjectEnvironmentSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectEnvironmentSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_project_overview_schema.go b/client/model_project_overview_schema.go new file mode 100644 index 0000000..8b7c888 --- /dev/null +++ b/client/model_project_overview_schema.go @@ -0,0 +1,812 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ProjectOverviewSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectOverviewSchema{} + +// ProjectOverviewSchema A high-level overview of a project. It contains information such as project statistics, the name of the project, what members and what features it contains, etc. +type ProjectOverviewSchema struct { + Stats *ProjectStatsSchema `json:"stats,omitempty"` + // The schema version used to describe the project overview + Version int32 `json:"version"` + // The name of this project + Name string `json:"name"` + // Additional information about the project + Description NullableString `json:"description,omitempty"` + // A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy + DefaultStickiness *string `json:"defaultStickiness,omitempty"` + // The project's [collaboration mode](https://docs.getunleash.io/reference/project-collaboration-mode). Determines whether non-project members can submit change requests or not. + Mode *string `json:"mode,omitempty"` + // A limit on the number of features allowed in the project. Null if no limit. + FeatureLimit NullableFloat32 `json:"featureLimit,omitempty"` + FeatureNaming *CreateFeatureNamingPatternSchema `json:"featureNaming,omitempty"` + // The number of members this project has + Members *float32 `json:"members,omitempty"` + // An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100 + Health *float32 `json:"health,omitempty"` + // The environments that are enabled for this project + Environments []ProjectEnvironmentSchema `json:"environments,omitempty"` + // The number of features of each type that are in this project + FeatureTypeCounts []FeatureTypeCountSchema `json:"featureTypeCounts,omitempty"` + // When the project was last updated. + UpdatedAt NullableTime `json:"updatedAt,omitempty"` + // When the project was archived. + ArchivedAt NullableTime `json:"archivedAt,omitempty"` + // When the project was created. + CreatedAt NullableTime `json:"createdAt,omitempty"` + // `true` if the project was favorited, otherwise `false`. + Favorite *bool `json:"favorite,omitempty"` + OnboardingStatus ProjectOverviewSchemaOnboardingStatus `json:"onboardingStatus"` + AdditionalProperties map[string]interface{} +} + +type _ProjectOverviewSchema ProjectOverviewSchema + +// NewProjectOverviewSchema instantiates a new ProjectOverviewSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectOverviewSchema(version int32, name string, onboardingStatus ProjectOverviewSchemaOnboardingStatus) *ProjectOverviewSchema { + this := ProjectOverviewSchema{} + this.Version = version + this.Name = name + this.OnboardingStatus = onboardingStatus + return &this +} + +// NewProjectOverviewSchemaWithDefaults instantiates a new ProjectOverviewSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectOverviewSchemaWithDefaults() *ProjectOverviewSchema { + this := ProjectOverviewSchema{} + return &this +} + +// GetStats returns the Stats field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetStats() ProjectStatsSchema { + if o == nil || IsNil(o.Stats) { + var ret ProjectStatsSchema + return ret + } + return *o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetStatsOk() (*ProjectStatsSchema, bool) { + if o == nil || IsNil(o.Stats) { + return nil, false + } + return o.Stats, true +} + +// HasStats returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasStats() bool { + if o != nil && !IsNil(o.Stats) { + return true + } + + return false +} + +// SetStats gets a reference to the given ProjectStatsSchema and assigns it to the Stats field. +func (o *ProjectOverviewSchema) SetStats(v ProjectStatsSchema) { + o.Stats = &v +} + +// GetVersion returns the Version field value +func (o *ProjectOverviewSchema) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ProjectOverviewSchema) SetVersion(v int32) { + o.Version = v +} + +// GetName returns the Name field value +func (o *ProjectOverviewSchema) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProjectOverviewSchema) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProjectOverviewSchema) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProjectOverviewSchema) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *ProjectOverviewSchema) SetDescription(v string) { + o.Description.Set(&v) +} + +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *ProjectOverviewSchema) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *ProjectOverviewSchema) UnsetDescription() { + o.Description.Unset() +} + +// GetDefaultStickiness returns the DefaultStickiness field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetDefaultStickiness() string { + if o == nil || IsNil(o.DefaultStickiness) { + var ret string + return ret + } + return *o.DefaultStickiness +} + +// GetDefaultStickinessOk returns a tuple with the DefaultStickiness field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetDefaultStickinessOk() (*string, bool) { + if o == nil || IsNil(o.DefaultStickiness) { + return nil, false + } + return o.DefaultStickiness, true +} + +// HasDefaultStickiness returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasDefaultStickiness() bool { + if o != nil && !IsNil(o.DefaultStickiness) { + return true + } + + return false +} + +// SetDefaultStickiness gets a reference to the given string and assigns it to the DefaultStickiness field. +func (o *ProjectOverviewSchema) SetDefaultStickiness(v string) { + o.DefaultStickiness = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetMode() string { + if o == nil || IsNil(o.Mode) { + var ret string + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetModeOk() (*string, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given string and assigns it to the Mode field. +func (o *ProjectOverviewSchema) SetMode(v string) { + o.Mode = &v +} + +// GetFeatureLimit returns the FeatureLimit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProjectOverviewSchema) GetFeatureLimit() float32 { + if o == nil || IsNil(o.FeatureLimit.Get()) { + var ret float32 + return ret + } + return *o.FeatureLimit.Get() +} + +// GetFeatureLimitOk returns a tuple with the FeatureLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProjectOverviewSchema) GetFeatureLimitOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.FeatureLimit.Get(), o.FeatureLimit.IsSet() +} + +// HasFeatureLimit returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasFeatureLimit() bool { + if o != nil && o.FeatureLimit.IsSet() { + return true + } + + return false +} + +// SetFeatureLimit gets a reference to the given NullableFloat32 and assigns it to the FeatureLimit field. +func (o *ProjectOverviewSchema) SetFeatureLimit(v float32) { + o.FeatureLimit.Set(&v) +} + +// SetFeatureLimitNil sets the value for FeatureLimit to be an explicit nil +func (o *ProjectOverviewSchema) SetFeatureLimitNil() { + o.FeatureLimit.Set(nil) +} + +// UnsetFeatureLimit ensures that no value is present for FeatureLimit, not even an explicit nil +func (o *ProjectOverviewSchema) UnsetFeatureLimit() { + o.FeatureLimit.Unset() +} + +// GetFeatureNaming returns the FeatureNaming field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetFeatureNaming() CreateFeatureNamingPatternSchema { + if o == nil || IsNil(o.FeatureNaming) { + var ret CreateFeatureNamingPatternSchema + return ret + } + return *o.FeatureNaming +} + +// GetFeatureNamingOk returns a tuple with the FeatureNaming field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetFeatureNamingOk() (*CreateFeatureNamingPatternSchema, bool) { + if o == nil || IsNil(o.FeatureNaming) { + return nil, false + } + return o.FeatureNaming, true +} + +// HasFeatureNaming returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasFeatureNaming() bool { + if o != nil && !IsNil(o.FeatureNaming) { + return true + } + + return false +} + +// SetFeatureNaming gets a reference to the given CreateFeatureNamingPatternSchema and assigns it to the FeatureNaming field. +func (o *ProjectOverviewSchema) SetFeatureNaming(v CreateFeatureNamingPatternSchema) { + o.FeatureNaming = &v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetMembers() float32 { + if o == nil || IsNil(o.Members) { + var ret float32 + return ret + } + return *o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetMembersOk() (*float32, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given float32 and assigns it to the Members field. +func (o *ProjectOverviewSchema) SetMembers(v float32) { + o.Members = &v +} + +// GetHealth returns the Health field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetHealth() float32 { + if o == nil || IsNil(o.Health) { + var ret float32 + return ret + } + return *o.Health +} + +// GetHealthOk returns a tuple with the Health field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetHealthOk() (*float32, bool) { + if o == nil || IsNil(o.Health) { + return nil, false + } + return o.Health, true +} + +// HasHealth returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasHealth() bool { + if o != nil && !IsNil(o.Health) { + return true + } + + return false +} + +// SetHealth gets a reference to the given float32 and assigns it to the Health field. +func (o *ProjectOverviewSchema) SetHealth(v float32) { + o.Health = &v +} + +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetEnvironments() []ProjectEnvironmentSchema { + if o == nil || IsNil(o.Environments) { + var ret []ProjectEnvironmentSchema + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetEnvironmentsOk() ([]ProjectEnvironmentSchema, bool) { + if o == nil || IsNil(o.Environments) { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasEnvironments() bool { + if o != nil && !IsNil(o.Environments) { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []ProjectEnvironmentSchema and assigns it to the Environments field. +func (o *ProjectOverviewSchema) SetEnvironments(v []ProjectEnvironmentSchema) { + o.Environments = v +} + +// GetFeatureTypeCounts returns the FeatureTypeCounts field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetFeatureTypeCounts() []FeatureTypeCountSchema { + if o == nil || IsNil(o.FeatureTypeCounts) { + var ret []FeatureTypeCountSchema + return ret + } + return o.FeatureTypeCounts +} + +// GetFeatureTypeCountsOk returns a tuple with the FeatureTypeCounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetFeatureTypeCountsOk() ([]FeatureTypeCountSchema, bool) { + if o == nil || IsNil(o.FeatureTypeCounts) { + return nil, false + } + return o.FeatureTypeCounts, true +} + +// HasFeatureTypeCounts returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasFeatureTypeCounts() bool { + if o != nil && !IsNil(o.FeatureTypeCounts) { + return true + } + + return false +} + +// SetFeatureTypeCounts gets a reference to the given []FeatureTypeCountSchema and assigns it to the FeatureTypeCounts field. +func (o *ProjectOverviewSchema) SetFeatureTypeCounts(v []FeatureTypeCountSchema) { + o.FeatureTypeCounts = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProjectOverviewSchema) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt.Get()) { + var ret time.Time + return ret + } + return *o.UpdatedAt.Get() +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProjectOverviewSchema) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.UpdatedAt.Get(), o.UpdatedAt.IsSet() +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasUpdatedAt() bool { + if o != nil && o.UpdatedAt.IsSet() { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given NullableTime and assigns it to the UpdatedAt field. +func (o *ProjectOverviewSchema) SetUpdatedAt(v time.Time) { + o.UpdatedAt.Set(&v) +} + +// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil +func (o *ProjectOverviewSchema) SetUpdatedAtNil() { + o.UpdatedAt.Set(nil) +} + +// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +func (o *ProjectOverviewSchema) UnsetUpdatedAt() { + o.UpdatedAt.Unset() +} + +// GetArchivedAt returns the ArchivedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProjectOverviewSchema) GetArchivedAt() time.Time { + if o == nil || IsNil(o.ArchivedAt.Get()) { + var ret time.Time + return ret + } + return *o.ArchivedAt.Get() +} + +// GetArchivedAtOk returns a tuple with the ArchivedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProjectOverviewSchema) GetArchivedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ArchivedAt.Get(), o.ArchivedAt.IsSet() +} + +// HasArchivedAt returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasArchivedAt() bool { + if o != nil && o.ArchivedAt.IsSet() { + return true + } + + return false +} + +// SetArchivedAt gets a reference to the given NullableTime and assigns it to the ArchivedAt field. +func (o *ProjectOverviewSchema) SetArchivedAt(v time.Time) { + o.ArchivedAt.Set(&v) +} + +// SetArchivedAtNil sets the value for ArchivedAt to be an explicit nil +func (o *ProjectOverviewSchema) SetArchivedAtNil() { + o.ArchivedAt.Set(nil) +} + +// UnsetArchivedAt ensures that no value is present for ArchivedAt, not even an explicit nil +func (o *ProjectOverviewSchema) UnsetArchivedAt() { + o.ArchivedAt.Unset() +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProjectOverviewSchema) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt.Get()) { + var ret time.Time + return ret + } + return *o.CreatedAt.Get() +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProjectOverviewSchema) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.CreatedAt.Get(), o.CreatedAt.IsSet() +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasCreatedAt() bool { + if o != nil && o.CreatedAt.IsSet() { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given NullableTime and assigns it to the CreatedAt field. +func (o *ProjectOverviewSchema) SetCreatedAt(v time.Time) { + o.CreatedAt.Set(&v) +} + +// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil +func (o *ProjectOverviewSchema) SetCreatedAtNil() { + o.CreatedAt.Set(nil) +} + +// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil +func (o *ProjectOverviewSchema) UnsetCreatedAt() { + o.CreatedAt.Unset() +} + +// GetFavorite returns the Favorite field value if set, zero value otherwise. +func (o *ProjectOverviewSchema) GetFavorite() bool { + if o == nil || IsNil(o.Favorite) { + var ret bool + return ret + } + return *o.Favorite +} + +// GetFavoriteOk returns a tuple with the Favorite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetFavoriteOk() (*bool, bool) { + if o == nil || IsNil(o.Favorite) { + return nil, false + } + return o.Favorite, true +} + +// HasFavorite returns a boolean if a field has been set. +func (o *ProjectOverviewSchema) HasFavorite() bool { + if o != nil && !IsNil(o.Favorite) { + return true + } + + return false +} + +// SetFavorite gets a reference to the given bool and assigns it to the Favorite field. +func (o *ProjectOverviewSchema) SetFavorite(v bool) { + o.Favorite = &v +} + +// GetOnboardingStatus returns the OnboardingStatus field value +func (o *ProjectOverviewSchema) GetOnboardingStatus() ProjectOverviewSchemaOnboardingStatus { + if o == nil { + var ret ProjectOverviewSchemaOnboardingStatus + return ret + } + + return o.OnboardingStatus +} + +// GetOnboardingStatusOk returns a tuple with the OnboardingStatus field value +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchema) GetOnboardingStatusOk() (*ProjectOverviewSchemaOnboardingStatus, bool) { + if o == nil { + return nil, false + } + return &o.OnboardingStatus, true +} + +// SetOnboardingStatus sets field value +func (o *ProjectOverviewSchema) SetOnboardingStatus(v ProjectOverviewSchemaOnboardingStatus) { + o.OnboardingStatus = v +} + +func (o ProjectOverviewSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectOverviewSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Stats) { + toSerialize["stats"] = o.Stats + } + toSerialize["version"] = o.Version + toSerialize["name"] = o.Name + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !IsNil(o.DefaultStickiness) { + toSerialize["defaultStickiness"] = o.DefaultStickiness + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if o.FeatureLimit.IsSet() { + toSerialize["featureLimit"] = o.FeatureLimit.Get() + } + if !IsNil(o.FeatureNaming) { + toSerialize["featureNaming"] = o.FeatureNaming + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + if !IsNil(o.Health) { + toSerialize["health"] = o.Health + } + if !IsNil(o.Environments) { + toSerialize["environments"] = o.Environments + } + if !IsNil(o.FeatureTypeCounts) { + toSerialize["featureTypeCounts"] = o.FeatureTypeCounts + } + if o.UpdatedAt.IsSet() { + toSerialize["updatedAt"] = o.UpdatedAt.Get() + } + if o.ArchivedAt.IsSet() { + toSerialize["archivedAt"] = o.ArchivedAt.Get() + } + if o.CreatedAt.IsSet() { + toSerialize["createdAt"] = o.CreatedAt.Get() + } + if !IsNil(o.Favorite) { + toSerialize["favorite"] = o.Favorite + } + toSerialize["onboardingStatus"] = o.OnboardingStatus + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectOverviewSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "version", + "name", + "onboardingStatus", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectOverviewSchema := _ProjectOverviewSchema{} + + err = json.Unmarshal(data, &varProjectOverviewSchema) + + if err != nil { + return err + } + + *o = ProjectOverviewSchema(varProjectOverviewSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "stats") + delete(additionalProperties, "version") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "defaultStickiness") + delete(additionalProperties, "mode") + delete(additionalProperties, "featureLimit") + delete(additionalProperties, "featureNaming") + delete(additionalProperties, "members") + delete(additionalProperties, "health") + delete(additionalProperties, "environments") + delete(additionalProperties, "featureTypeCounts") + delete(additionalProperties, "updatedAt") + delete(additionalProperties, "archivedAt") + delete(additionalProperties, "createdAt") + delete(additionalProperties, "favorite") + delete(additionalProperties, "onboardingStatus") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectOverviewSchema struct { + value *ProjectOverviewSchema + isSet bool +} + +func (v NullableProjectOverviewSchema) Get() *ProjectOverviewSchema { + return v.value +} + +func (v *NullableProjectOverviewSchema) Set(val *ProjectOverviewSchema) { + v.value = val + v.isSet = true +} + +func (v NullableProjectOverviewSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectOverviewSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectOverviewSchema(val *ProjectOverviewSchema) *NullableProjectOverviewSchema { + return &NullableProjectOverviewSchema{value: val, isSet: true} +} + +func (v NullableProjectOverviewSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectOverviewSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_project_overview_schema_onboarding_status.go b/client/model_project_overview_schema_onboarding_status.go new file mode 100644 index 0000000..cac199e --- /dev/null +++ b/client/model_project_overview_schema_onboarding_status.go @@ -0,0 +1,154 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" + "gopkg.in/validator.v2" +) + +// ProjectOverviewSchemaOnboardingStatus - The current onboarding status of the project. +type ProjectOverviewSchemaOnboardingStatus struct { + ProjectOverviewSchemaOnboardingStatusOneOf *ProjectOverviewSchemaOnboardingStatusOneOf + ProjectOverviewSchemaOnboardingStatusOneOf1 *ProjectOverviewSchemaOnboardingStatusOneOf1 +} + +// ProjectOverviewSchemaOnboardingStatusOneOfAsProjectOverviewSchemaOnboardingStatus is a convenience function that returns ProjectOverviewSchemaOnboardingStatusOneOf wrapped in ProjectOverviewSchemaOnboardingStatus +func ProjectOverviewSchemaOnboardingStatusOneOfAsProjectOverviewSchemaOnboardingStatus(v *ProjectOverviewSchemaOnboardingStatusOneOf) ProjectOverviewSchemaOnboardingStatus { + return ProjectOverviewSchemaOnboardingStatus{ + ProjectOverviewSchemaOnboardingStatusOneOf: v, + } +} + +// ProjectOverviewSchemaOnboardingStatusOneOf1AsProjectOverviewSchemaOnboardingStatus is a convenience function that returns ProjectOverviewSchemaOnboardingStatusOneOf1 wrapped in ProjectOverviewSchemaOnboardingStatus +func ProjectOverviewSchemaOnboardingStatusOneOf1AsProjectOverviewSchemaOnboardingStatus(v *ProjectOverviewSchemaOnboardingStatusOneOf1) ProjectOverviewSchemaOnboardingStatus { + return ProjectOverviewSchemaOnboardingStatus{ + ProjectOverviewSchemaOnboardingStatusOneOf1: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ProjectOverviewSchemaOnboardingStatus) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ProjectOverviewSchemaOnboardingStatusOneOf + err = newStrictDecoder(data).Decode(&dst.ProjectOverviewSchemaOnboardingStatusOneOf) + if err == nil { + jsonProjectOverviewSchemaOnboardingStatusOneOf, _ := json.Marshal(dst.ProjectOverviewSchemaOnboardingStatusOneOf) + if string(jsonProjectOverviewSchemaOnboardingStatusOneOf) == "{}" { // empty struct + dst.ProjectOverviewSchemaOnboardingStatusOneOf = nil + } else { + if err = validator.Validate(dst.ProjectOverviewSchemaOnboardingStatusOneOf); err != nil { + dst.ProjectOverviewSchemaOnboardingStatusOneOf = nil + } else { + match++ + } + } + } else { + dst.ProjectOverviewSchemaOnboardingStatusOneOf = nil + } + + // try to unmarshal data into ProjectOverviewSchemaOnboardingStatusOneOf1 + err = newStrictDecoder(data).Decode(&dst.ProjectOverviewSchemaOnboardingStatusOneOf1) + if err == nil { + jsonProjectOverviewSchemaOnboardingStatusOneOf1, _ := json.Marshal(dst.ProjectOverviewSchemaOnboardingStatusOneOf1) + if string(jsonProjectOverviewSchemaOnboardingStatusOneOf1) == "{}" { // empty struct + dst.ProjectOverviewSchemaOnboardingStatusOneOf1 = nil + } else { + if err = validator.Validate(dst.ProjectOverviewSchemaOnboardingStatusOneOf1); err != nil { + dst.ProjectOverviewSchemaOnboardingStatusOneOf1 = nil + } else { + match++ + } + } + } else { + dst.ProjectOverviewSchemaOnboardingStatusOneOf1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ProjectOverviewSchemaOnboardingStatusOneOf = nil + dst.ProjectOverviewSchemaOnboardingStatusOneOf1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ProjectOverviewSchemaOnboardingStatus)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ProjectOverviewSchemaOnboardingStatus)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ProjectOverviewSchemaOnboardingStatus) MarshalJSON() ([]byte, error) { + if src.ProjectOverviewSchemaOnboardingStatusOneOf != nil { + return json.Marshal(&src.ProjectOverviewSchemaOnboardingStatusOneOf) + } + + if src.ProjectOverviewSchemaOnboardingStatusOneOf1 != nil { + return json.Marshal(&src.ProjectOverviewSchemaOnboardingStatusOneOf1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ProjectOverviewSchemaOnboardingStatus) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.ProjectOverviewSchemaOnboardingStatusOneOf != nil { + return obj.ProjectOverviewSchemaOnboardingStatusOneOf + } + + if obj.ProjectOverviewSchemaOnboardingStatusOneOf1 != nil { + return obj.ProjectOverviewSchemaOnboardingStatusOneOf1 + } + + // all schemas are nil + return nil +} + +type NullableProjectOverviewSchemaOnboardingStatus struct { + value *ProjectOverviewSchemaOnboardingStatus + isSet bool +} + +func (v NullableProjectOverviewSchemaOnboardingStatus) Get() *ProjectOverviewSchemaOnboardingStatus { + return v.value +} + +func (v *NullableProjectOverviewSchemaOnboardingStatus) Set(val *ProjectOverviewSchemaOnboardingStatus) { + v.value = val + v.isSet = true +} + +func (v NullableProjectOverviewSchemaOnboardingStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectOverviewSchemaOnboardingStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectOverviewSchemaOnboardingStatus(val *ProjectOverviewSchemaOnboardingStatus) *NullableProjectOverviewSchemaOnboardingStatus { + return &NullableProjectOverviewSchemaOnboardingStatus{value: val, isSet: true} +} + +func (v NullableProjectOverviewSchemaOnboardingStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectOverviewSchemaOnboardingStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_project_overview_schema_onboarding_status_one_of.go b/client/model_project_overview_schema_onboarding_status_one_of.go new file mode 100644 index 0000000..28178e3 --- /dev/null +++ b/client/model_project_overview_schema_onboarding_status_one_of.go @@ -0,0 +1,166 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProjectOverviewSchemaOnboardingStatusOneOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectOverviewSchemaOnboardingStatusOneOf{} + +// ProjectOverviewSchemaOnboardingStatusOneOf struct for ProjectOverviewSchemaOnboardingStatusOneOf +type ProjectOverviewSchemaOnboardingStatusOneOf struct { + Status string `json:"status"` + AdditionalProperties map[string]interface{} +} + +type _ProjectOverviewSchemaOnboardingStatusOneOf ProjectOverviewSchemaOnboardingStatusOneOf + +// NewProjectOverviewSchemaOnboardingStatusOneOf instantiates a new ProjectOverviewSchemaOnboardingStatusOneOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectOverviewSchemaOnboardingStatusOneOf(status string) *ProjectOverviewSchemaOnboardingStatusOneOf { + this := ProjectOverviewSchemaOnboardingStatusOneOf{} + this.Status = status + return &this +} + +// NewProjectOverviewSchemaOnboardingStatusOneOfWithDefaults instantiates a new ProjectOverviewSchemaOnboardingStatusOneOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectOverviewSchemaOnboardingStatusOneOfWithDefaults() *ProjectOverviewSchemaOnboardingStatusOneOf { + this := ProjectOverviewSchemaOnboardingStatusOneOf{} + return &this +} + +// GetStatus returns the Status field value +func (o *ProjectOverviewSchemaOnboardingStatusOneOf) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchemaOnboardingStatusOneOf) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ProjectOverviewSchemaOnboardingStatusOneOf) SetStatus(v string) { + o.Status = v +} + +func (o ProjectOverviewSchemaOnboardingStatusOneOf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectOverviewSchemaOnboardingStatusOneOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectOverviewSchemaOnboardingStatusOneOf) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectOverviewSchemaOnboardingStatusOneOf := _ProjectOverviewSchemaOnboardingStatusOneOf{} + + err = json.Unmarshal(data, &varProjectOverviewSchemaOnboardingStatusOneOf) + + if err != nil { + return err + } + + *o = ProjectOverviewSchemaOnboardingStatusOneOf(varProjectOverviewSchemaOnboardingStatusOneOf) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectOverviewSchemaOnboardingStatusOneOf struct { + value *ProjectOverviewSchemaOnboardingStatusOneOf + isSet bool +} + +func (v NullableProjectOverviewSchemaOnboardingStatusOneOf) Get() *ProjectOverviewSchemaOnboardingStatusOneOf { + return v.value +} + +func (v *NullableProjectOverviewSchemaOnboardingStatusOneOf) Set(val *ProjectOverviewSchemaOnboardingStatusOneOf) { + v.value = val + v.isSet = true +} + +func (v NullableProjectOverviewSchemaOnboardingStatusOneOf) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectOverviewSchemaOnboardingStatusOneOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectOverviewSchemaOnboardingStatusOneOf(val *ProjectOverviewSchemaOnboardingStatusOneOf) *NullableProjectOverviewSchemaOnboardingStatusOneOf { + return &NullableProjectOverviewSchemaOnboardingStatusOneOf{value: val, isSet: true} +} + +func (v NullableProjectOverviewSchemaOnboardingStatusOneOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectOverviewSchemaOnboardingStatusOneOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_project_overview_schema_onboarding_status_one_of_1.go b/client/model_project_overview_schema_onboarding_status_one_of_1.go new file mode 100644 index 0000000..e26c33d --- /dev/null +++ b/client/model_project_overview_schema_onboarding_status_one_of_1.go @@ -0,0 +1,196 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProjectOverviewSchemaOnboardingStatusOneOf1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectOverviewSchemaOnboardingStatusOneOf1{} + +// ProjectOverviewSchemaOnboardingStatusOneOf1 struct for ProjectOverviewSchemaOnboardingStatusOneOf1 +type ProjectOverviewSchemaOnboardingStatusOneOf1 struct { + Status string `json:"status"` + // The name of the feature flag + Feature string `json:"feature"` + AdditionalProperties map[string]interface{} +} + +type _ProjectOverviewSchemaOnboardingStatusOneOf1 ProjectOverviewSchemaOnboardingStatusOneOf1 + +// NewProjectOverviewSchemaOnboardingStatusOneOf1 instantiates a new ProjectOverviewSchemaOnboardingStatusOneOf1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectOverviewSchemaOnboardingStatusOneOf1(status string, feature string) *ProjectOverviewSchemaOnboardingStatusOneOf1 { + this := ProjectOverviewSchemaOnboardingStatusOneOf1{} + this.Status = status + this.Feature = feature + return &this +} + +// NewProjectOverviewSchemaOnboardingStatusOneOf1WithDefaults instantiates a new ProjectOverviewSchemaOnboardingStatusOneOf1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectOverviewSchemaOnboardingStatusOneOf1WithDefaults() *ProjectOverviewSchemaOnboardingStatusOneOf1 { + this := ProjectOverviewSchemaOnboardingStatusOneOf1{} + return &this +} + +// GetStatus returns the Status field value +func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) SetStatus(v string) { + o.Status = v +} + +// GetFeature returns the Feature field value +func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) GetFeature() string { + if o == nil { + var ret string + return ret + } + + return o.Feature +} + +// GetFeatureOk returns a tuple with the Feature field value +// and a boolean to check if the value has been set. +func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) GetFeatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Feature, true +} + +// SetFeature sets field value +func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) SetFeature(v string) { + o.Feature = v +} + +func (o ProjectOverviewSchemaOnboardingStatusOneOf1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectOverviewSchemaOnboardingStatusOneOf1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["feature"] = o.Feature + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectOverviewSchemaOnboardingStatusOneOf1) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "status", + "feature", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectOverviewSchemaOnboardingStatusOneOf1 := _ProjectOverviewSchemaOnboardingStatusOneOf1{} + + err = json.Unmarshal(data, &varProjectOverviewSchemaOnboardingStatusOneOf1) + + if err != nil { + return err + } + + *o = ProjectOverviewSchemaOnboardingStatusOneOf1(varProjectOverviewSchemaOnboardingStatusOneOf1) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "feature") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectOverviewSchemaOnboardingStatusOneOf1 struct { + value *ProjectOverviewSchemaOnboardingStatusOneOf1 + isSet bool +} + +func (v NullableProjectOverviewSchemaOnboardingStatusOneOf1) Get() *ProjectOverviewSchemaOnboardingStatusOneOf1 { + return v.value +} + +func (v *NullableProjectOverviewSchemaOnboardingStatusOneOf1) Set(val *ProjectOverviewSchemaOnboardingStatusOneOf1) { + v.value = val + v.isSet = true +} + +func (v NullableProjectOverviewSchemaOnboardingStatusOneOf1) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectOverviewSchemaOnboardingStatusOneOf1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectOverviewSchemaOnboardingStatusOneOf1(val *ProjectOverviewSchemaOnboardingStatusOneOf1) *NullableProjectOverviewSchemaOnboardingStatusOneOf1 { + return &NullableProjectOverviewSchemaOnboardingStatusOneOf1{value: val, isSet: true} +} + +func (v NullableProjectOverviewSchemaOnboardingStatusOneOf1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectOverviewSchemaOnboardingStatusOneOf1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_project_stats_schema.go b/client/model_project_stats_schema.go new file mode 100644 index 0000000..27641d8 --- /dev/null +++ b/client/model_project_stats_schema.go @@ -0,0 +1,377 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProjectStatsSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectStatsSchema{} + +// ProjectStatsSchema Statistics for a project, including the average time to production, number of features created, the project activity and more. Stats are divided into current and previous **windows**. - The **current window** is the past 30 days. - The **previous window** is the 30 days **before** the current window (from 60 to 30 days ago) +type ProjectStatsSchema struct { + // The average time from when a feature was created to when it was enabled in the \"production\" environment during the current window + AvgTimeToProdCurrentWindow float32 `json:"avgTimeToProdCurrentWindow"` + // The number of feature flags created during the current window + CreatedCurrentWindow float32 `json:"createdCurrentWindow"` + // The number of feature flags created during the previous window + CreatedPastWindow float32 `json:"createdPastWindow"` + // The number of feature flags that were archived during the current window + ArchivedCurrentWindow float32 `json:"archivedCurrentWindow"` + // The number of feature flags that were archived during the previous window + ArchivedPastWindow float32 `json:"archivedPastWindow"` + // The number of project events that occurred during the current window + ProjectActivityCurrentWindow float32 `json:"projectActivityCurrentWindow"` + // The number of project events that occurred during the previous window + ProjectActivityPastWindow float32 `json:"projectActivityPastWindow"` + // The number of members that were added to the project during the current window + ProjectMembersAddedCurrentWindow float32 `json:"projectMembersAddedCurrentWindow"` + AdditionalProperties map[string]interface{} +} + +type _ProjectStatsSchema ProjectStatsSchema + +// NewProjectStatsSchema instantiates a new ProjectStatsSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectStatsSchema(avgTimeToProdCurrentWindow float32, createdCurrentWindow float32, createdPastWindow float32, archivedCurrentWindow float32, archivedPastWindow float32, projectActivityCurrentWindow float32, projectActivityPastWindow float32, projectMembersAddedCurrentWindow float32) *ProjectStatsSchema { + this := ProjectStatsSchema{} + this.AvgTimeToProdCurrentWindow = avgTimeToProdCurrentWindow + this.CreatedCurrentWindow = createdCurrentWindow + this.CreatedPastWindow = createdPastWindow + this.ArchivedCurrentWindow = archivedCurrentWindow + this.ArchivedPastWindow = archivedPastWindow + this.ProjectActivityCurrentWindow = projectActivityCurrentWindow + this.ProjectActivityPastWindow = projectActivityPastWindow + this.ProjectMembersAddedCurrentWindow = projectMembersAddedCurrentWindow + return &this +} + +// NewProjectStatsSchemaWithDefaults instantiates a new ProjectStatsSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectStatsSchemaWithDefaults() *ProjectStatsSchema { + this := ProjectStatsSchema{} + return &this +} + +// GetAvgTimeToProdCurrentWindow returns the AvgTimeToProdCurrentWindow field value +func (o *ProjectStatsSchema) GetAvgTimeToProdCurrentWindow() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.AvgTimeToProdCurrentWindow +} + +// GetAvgTimeToProdCurrentWindowOk returns a tuple with the AvgTimeToProdCurrentWindow field value +// and a boolean to check if the value has been set. +func (o *ProjectStatsSchema) GetAvgTimeToProdCurrentWindowOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.AvgTimeToProdCurrentWindow, true +} + +// SetAvgTimeToProdCurrentWindow sets field value +func (o *ProjectStatsSchema) SetAvgTimeToProdCurrentWindow(v float32) { + o.AvgTimeToProdCurrentWindow = v +} + +// GetCreatedCurrentWindow returns the CreatedCurrentWindow field value +func (o *ProjectStatsSchema) GetCreatedCurrentWindow() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CreatedCurrentWindow +} + +// GetCreatedCurrentWindowOk returns a tuple with the CreatedCurrentWindow field value +// and a boolean to check if the value has been set. +func (o *ProjectStatsSchema) GetCreatedCurrentWindowOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CreatedCurrentWindow, true +} + +// SetCreatedCurrentWindow sets field value +func (o *ProjectStatsSchema) SetCreatedCurrentWindow(v float32) { + o.CreatedCurrentWindow = v +} + +// GetCreatedPastWindow returns the CreatedPastWindow field value +func (o *ProjectStatsSchema) GetCreatedPastWindow() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CreatedPastWindow +} + +// GetCreatedPastWindowOk returns a tuple with the CreatedPastWindow field value +// and a boolean to check if the value has been set. +func (o *ProjectStatsSchema) GetCreatedPastWindowOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CreatedPastWindow, true +} + +// SetCreatedPastWindow sets field value +func (o *ProjectStatsSchema) SetCreatedPastWindow(v float32) { + o.CreatedPastWindow = v +} + +// GetArchivedCurrentWindow returns the ArchivedCurrentWindow field value +func (o *ProjectStatsSchema) GetArchivedCurrentWindow() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ArchivedCurrentWindow +} + +// GetArchivedCurrentWindowOk returns a tuple with the ArchivedCurrentWindow field value +// and a boolean to check if the value has been set. +func (o *ProjectStatsSchema) GetArchivedCurrentWindowOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ArchivedCurrentWindow, true +} + +// SetArchivedCurrentWindow sets field value +func (o *ProjectStatsSchema) SetArchivedCurrentWindow(v float32) { + o.ArchivedCurrentWindow = v +} + +// GetArchivedPastWindow returns the ArchivedPastWindow field value +func (o *ProjectStatsSchema) GetArchivedPastWindow() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ArchivedPastWindow +} + +// GetArchivedPastWindowOk returns a tuple with the ArchivedPastWindow field value +// and a boolean to check if the value has been set. +func (o *ProjectStatsSchema) GetArchivedPastWindowOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ArchivedPastWindow, true +} + +// SetArchivedPastWindow sets field value +func (o *ProjectStatsSchema) SetArchivedPastWindow(v float32) { + o.ArchivedPastWindow = v +} + +// GetProjectActivityCurrentWindow returns the ProjectActivityCurrentWindow field value +func (o *ProjectStatsSchema) GetProjectActivityCurrentWindow() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ProjectActivityCurrentWindow +} + +// GetProjectActivityCurrentWindowOk returns a tuple with the ProjectActivityCurrentWindow field value +// and a boolean to check if the value has been set. +func (o *ProjectStatsSchema) GetProjectActivityCurrentWindowOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ProjectActivityCurrentWindow, true +} + +// SetProjectActivityCurrentWindow sets field value +func (o *ProjectStatsSchema) SetProjectActivityCurrentWindow(v float32) { + o.ProjectActivityCurrentWindow = v +} + +// GetProjectActivityPastWindow returns the ProjectActivityPastWindow field value +func (o *ProjectStatsSchema) GetProjectActivityPastWindow() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ProjectActivityPastWindow +} + +// GetProjectActivityPastWindowOk returns a tuple with the ProjectActivityPastWindow field value +// and a boolean to check if the value has been set. +func (o *ProjectStatsSchema) GetProjectActivityPastWindowOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ProjectActivityPastWindow, true +} + +// SetProjectActivityPastWindow sets field value +func (o *ProjectStatsSchema) SetProjectActivityPastWindow(v float32) { + o.ProjectActivityPastWindow = v +} + +// GetProjectMembersAddedCurrentWindow returns the ProjectMembersAddedCurrentWindow field value +func (o *ProjectStatsSchema) GetProjectMembersAddedCurrentWindow() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ProjectMembersAddedCurrentWindow +} + +// GetProjectMembersAddedCurrentWindowOk returns a tuple with the ProjectMembersAddedCurrentWindow field value +// and a boolean to check if the value has been set. +func (o *ProjectStatsSchema) GetProjectMembersAddedCurrentWindowOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ProjectMembersAddedCurrentWindow, true +} + +// SetProjectMembersAddedCurrentWindow sets field value +func (o *ProjectStatsSchema) SetProjectMembersAddedCurrentWindow(v float32) { + o.ProjectMembersAddedCurrentWindow = v +} + +func (o ProjectStatsSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectStatsSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["avgTimeToProdCurrentWindow"] = o.AvgTimeToProdCurrentWindow + toSerialize["createdCurrentWindow"] = o.CreatedCurrentWindow + toSerialize["createdPastWindow"] = o.CreatedPastWindow + toSerialize["archivedCurrentWindow"] = o.ArchivedCurrentWindow + toSerialize["archivedPastWindow"] = o.ArchivedPastWindow + toSerialize["projectActivityCurrentWindow"] = o.ProjectActivityCurrentWindow + toSerialize["projectActivityPastWindow"] = o.ProjectActivityPastWindow + toSerialize["projectMembersAddedCurrentWindow"] = o.ProjectMembersAddedCurrentWindow + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectStatsSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "avgTimeToProdCurrentWindow", + "createdCurrentWindow", + "createdPastWindow", + "archivedCurrentWindow", + "archivedPastWindow", + "projectActivityCurrentWindow", + "projectActivityPastWindow", + "projectMembersAddedCurrentWindow", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectStatsSchema := _ProjectStatsSchema{} + + err = json.Unmarshal(data, &varProjectStatsSchema) + + if err != nil { + return err + } + + *o = ProjectStatsSchema(varProjectStatsSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "avgTimeToProdCurrentWindow") + delete(additionalProperties, "createdCurrentWindow") + delete(additionalProperties, "createdPastWindow") + delete(additionalProperties, "archivedCurrentWindow") + delete(additionalProperties, "archivedPastWindow") + delete(additionalProperties, "projectActivityCurrentWindow") + delete(additionalProperties, "projectActivityPastWindow") + delete(additionalProperties, "projectMembersAddedCurrentWindow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectStatsSchema struct { + value *ProjectStatsSchema + isSet bool +} + +func (v NullableProjectStatsSchema) Get() *ProjectStatsSchema { + return v.value +} + +func (v *NullableProjectStatsSchema) Set(val *ProjectStatsSchema) { + v.value = val + v.isSet = true +} + +func (v NullableProjectStatsSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectStatsSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectStatsSchema(val *ProjectStatsSchema) *NullableProjectStatsSchema { + return &NullableProjectStatsSchema{value: val, isSet: true} +} + +func (v NullableProjectStatsSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectStatsSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client/model_update_change_request_environment_config_schema.go b/client/model_update_change_request_environment_config_schema.go new file mode 100644 index 0000000..8d5eaf3 --- /dev/null +++ b/client/model_update_change_request_environment_config_schema.go @@ -0,0 +1,205 @@ +/* +Unleash API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 6.7.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateChangeRequestEnvironmentConfigSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateChangeRequestEnvironmentConfigSchema{} + +// UpdateChangeRequestEnvironmentConfigSchema Data used to update change request in an environment +type UpdateChangeRequestEnvironmentConfigSchema struct { + // `true` if change requests should be enabled, otherwise `false`. + ChangeRequestsEnabled bool `json:"changeRequestsEnabled"` + // The number of approvals required before a change request can be applied in this environment. + RequiredApprovals *int32 `json:"requiredApprovals,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateChangeRequestEnvironmentConfigSchema UpdateChangeRequestEnvironmentConfigSchema + +// NewUpdateChangeRequestEnvironmentConfigSchema instantiates a new UpdateChangeRequestEnvironmentConfigSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateChangeRequestEnvironmentConfigSchema(changeRequestsEnabled bool) *UpdateChangeRequestEnvironmentConfigSchema { + this := UpdateChangeRequestEnvironmentConfigSchema{} + this.ChangeRequestsEnabled = changeRequestsEnabled + return &this +} + +// NewUpdateChangeRequestEnvironmentConfigSchemaWithDefaults instantiates a new UpdateChangeRequestEnvironmentConfigSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateChangeRequestEnvironmentConfigSchemaWithDefaults() *UpdateChangeRequestEnvironmentConfigSchema { + this := UpdateChangeRequestEnvironmentConfigSchema{} + return &this +} + +// GetChangeRequestsEnabled returns the ChangeRequestsEnabled field value +func (o *UpdateChangeRequestEnvironmentConfigSchema) GetChangeRequestsEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.ChangeRequestsEnabled +} + +// GetChangeRequestsEnabledOk returns a tuple with the ChangeRequestsEnabled field value +// and a boolean to check if the value has been set. +func (o *UpdateChangeRequestEnvironmentConfigSchema) GetChangeRequestsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ChangeRequestsEnabled, true +} + +// SetChangeRequestsEnabled sets field value +func (o *UpdateChangeRequestEnvironmentConfigSchema) SetChangeRequestsEnabled(v bool) { + o.ChangeRequestsEnabled = v +} + +// GetRequiredApprovals returns the RequiredApprovals field value if set, zero value otherwise. +func (o *UpdateChangeRequestEnvironmentConfigSchema) GetRequiredApprovals() int32 { + if o == nil || IsNil(o.RequiredApprovals) { + var ret int32 + return ret + } + return *o.RequiredApprovals +} + +// GetRequiredApprovalsOk returns a tuple with the RequiredApprovals field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateChangeRequestEnvironmentConfigSchema) GetRequiredApprovalsOk() (*int32, bool) { + if o == nil || IsNil(o.RequiredApprovals) { + return nil, false + } + return o.RequiredApprovals, true +} + +// HasRequiredApprovals returns a boolean if a field has been set. +func (o *UpdateChangeRequestEnvironmentConfigSchema) HasRequiredApprovals() bool { + if o != nil && !IsNil(o.RequiredApprovals) { + return true + } + + return false +} + +// SetRequiredApprovals gets a reference to the given int32 and assigns it to the RequiredApprovals field. +func (o *UpdateChangeRequestEnvironmentConfigSchema) SetRequiredApprovals(v int32) { + o.RequiredApprovals = &v +} + +func (o UpdateChangeRequestEnvironmentConfigSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateChangeRequestEnvironmentConfigSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["changeRequestsEnabled"] = o.ChangeRequestsEnabled + if !IsNil(o.RequiredApprovals) { + toSerialize["requiredApprovals"] = o.RequiredApprovals + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateChangeRequestEnvironmentConfigSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "changeRequestsEnabled", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateChangeRequestEnvironmentConfigSchema := _UpdateChangeRequestEnvironmentConfigSchema{} + + err = json.Unmarshal(data, &varUpdateChangeRequestEnvironmentConfigSchema) + + if err != nil { + return err + } + + *o = UpdateChangeRequestEnvironmentConfigSchema(varUpdateChangeRequestEnvironmentConfigSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "changeRequestsEnabled") + delete(additionalProperties, "requiredApprovals") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateChangeRequestEnvironmentConfigSchema struct { + value *UpdateChangeRequestEnvironmentConfigSchema + isSet bool +} + +func (v NullableUpdateChangeRequestEnvironmentConfigSchema) Get() *UpdateChangeRequestEnvironmentConfigSchema { + return v.value +} + +func (v *NullableUpdateChangeRequestEnvironmentConfigSchema) Set(val *UpdateChangeRequestEnvironmentConfigSchema) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateChangeRequestEnvironmentConfigSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateChangeRequestEnvironmentConfigSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateChangeRequestEnvironmentConfigSchema(val *UpdateChangeRequestEnvironmentConfigSchema) *NullableUpdateChangeRequestEnvironmentConfigSchema { + return &NullableUpdateChangeRequestEnvironmentConfigSchema{value: val, isSet: true} +} + +func (v NullableUpdateChangeRequestEnvironmentConfigSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateChangeRequestEnvironmentConfigSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/filter-ops.json b/filter-ops.json index 8fdd6ec..d2a9702 100644 --- a/filter-ops.json +++ b/filter-ops.json @@ -5,4 +5,4 @@ "description", "mode" ] -} \ No newline at end of file +} diff --git a/modified-openapi.json b/modified-openapi.json index aabd053..2c763ad 100644 --- a/modified-openapi.json +++ b/modified-openapi.json @@ -1801,6 +1801,82 @@ ] } }, + "/api/admin/projects/{projectId}/change-requests/config": { + "get": { + "operationId": "getProjectChangeRequestConfig", + "summary": "Retrieves change request configuration for a project", + "description": "Given a projectId, this endpoint will retrieve change request configuration for the project", + "parameters": [ + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "changeRequestConfigSchema", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/changeRequestConfigSchema" + } + } + } + } + }, + "tags": [ + "Change Requests" + ] + } + }, + "/api/admin/projects/{projectId}/environments/{environment}/change-requests/config": { + "put": { + "operationId": "updateProjectChangeRequestConfig", + "summary": "Updates change request configuration for an environment in the project", + "description": "This endpoint will change the change request configuration for a given environment, set it to either on/off and optionally configure the number of approvals needed. The minimum number of approvals is 1 and the maximum number is 10. If you provide a number higher than 10 or lower than 1, Unleash will clamp it to the allowed range.", + "parameters": [ + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "environment", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "updateChangeRequestEnvironmentConfigSchema", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/updateChangeRequestEnvironmentConfigSchema" + } + } + } + }, + "responses": { + "200": { + "description": "This response has no body." + } + }, + "tags": [ + "Change Requests" + ] + } + }, "/api/admin/service-account": { "get": { "operationId": "getServiceAccounts", @@ -4742,6 +4818,119 @@ ] } }, + "/api/admin/projects/{projectId}/overview": { + "get": { + "operationId": "getProjectOverview", + "summary": "Get an overview of a project.", + "description": "This endpoint returns an overview of the specified projects stats, project health, number of members, which environments are configured, and the features types in the project.", + "parameters": [ + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "projectOverviewSchema", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/projectOverviewSchema" + } + } + } + }, + "401": { + "description": "Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "The ID of the error instance", + "type": "string", + "example": "9c40958a-daac-400e-98fb-3bb438567008" + }, + "name": { + "description": "The name of the error kind", + "type": "string", + "example": "AuthenticationRequired" + }, + "message": { + "description": "A description of what went wrong.", + "type": "string", + "example": "You must log in to use Unleash. Your request had no authorization header, so we could not authorize you. Try logging in at /auth/simple/login." + } + } + } + } + } + }, + "403": { + "description": "The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "The ID of the error instance", + "type": "string", + "example": "9c40958a-daac-400e-98fb-3bb438567008" + }, + "name": { + "description": "The name of the error kind", + "type": "string", + "example": "NoAccessError" + }, + "message": { + "description": "A description of what went wrong.", + "type": "string", + "example": "You need the \"UPDATE_ADDON\" permission to perform this action in the \"development\" environment." + } + } + } + } + } + }, + "404": { + "description": "The requested resource was not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "The ID of the error instance", + "type": "string", + "example": "9c40958a-daac-400e-98fb-3bb438567008" + }, + "name": { + "description": "The name of the error kind", + "type": "string", + "example": "NotFoundError" + }, + "message": { + "description": "A description of what went wrong.", + "type": "string", + "example": "Could not find the addon with ID \"12345\"." + } + } + } + } + } + } + }, + "tags": [ + "Projects" + ] + } + }, "/api/admin/environments/{name}/on": { "post": { "operationId": "toggleEnvironmentOn", @@ -5062,6 +5251,70 @@ "tokens" ] }, + "constraintSchema": { + "description": "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/reference/activation-strategies#constraints)", + "type": "object", + "properties": { + "contextName": { + "description": "The name of the context field that this constraint should apply to.", + "type": "string", + "example": "appName" + }, + "operator": { + "description": "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/reference/activation-strategies#constraint-operators).", + "type": "string", + "example": "IN", + "enum": [ + "NOT_IN", + "IN", + "STR_ENDS_WITH", + "STR_STARTS_WITH", + "STR_CONTAINS", + "NUM_EQ", + "NUM_GT", + "NUM_GTE", + "NUM_LT", + "NUM_LTE", + "DATE_AFTER", + "DATE_BEFORE", + "SEMVER_EQ", + "SEMVER_GT", + "SEMVER_LT" + ] + }, + "caseInsensitive": { + "description": "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).", + "type": "boolean", + "default": false + }, + "inverted": { + "description": "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.", + "type": "boolean", + "default": false + }, + "values": { + "description": "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "my-app", + "my-other-app" + ] + }, + "value": { + "description": "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.", + "type": "string", + "example": "my-app" + } + }, + "additionalProperties": true, + "required": [ + "contextName", + "operator" + ] + }, "contextFieldSchema": { "description": "A representation of a [context field](https://docs.getunleash.io/reference/unleash-context).", "type": "object", @@ -5356,6 +5609,83 @@ "pattern" ] }, + "createFeatureStrategySchema": { + "description": "Create a strategy configuration in a feature", + "type": "object", + "properties": { + "name": { + "description": "The name of the strategy type", + "type": "string", + "example": "flexibleRollout" + }, + "title": { + "description": "A descriptive title for the strategy", + "type": "string", + "example": "Gradual Rollout 25-Prod", + "nullable": true + }, + "disabled": { + "description": "A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs", + "type": "boolean", + "example": false, + "nullable": true + }, + "sortOrder": { + "description": "The order of the strategy in the list", + "type": "number", + "example": 9999 + }, + "constraints": { + "description": "A list of the constraints attached to the strategy. See https://docs.getunleash.io/reference/activation-strategies#constraints", + "type": "array", + "items": { + "$ref": "#/components/schemas/constraintSchema" + }, + "example": [ + { + "values": [ + "1", + "2" + ], + "inverted": false, + "operator": "IN", + "contextName": "appName", + "caseInsensitive": false + } + ] + }, + "variants": { + "description": "Strategy level variants", + "type": "array", + "items": { + "$ref": "#/components/schemas/createStrategyVariantSchema" + } + }, + "parameters": { + "description": "An object containing the parameters for the strategy", + "$ref": "#/components/schemas/parametersSchema", + "example": { + "groupId": "some_new", + "rollout": "25", + "stickiness": "sessionId" + } + }, + "segments": { + "description": "Ids of segments to use for this strategy", + "type": "array", + "items": { + "type": "number" + }, + "example": [ + 1, + 2 + ] + } + }, + "required": [ + "name" + ] + }, "createPatSchema": { "description": "Describes the properties required to create a [personal access token](https://docs.getunleash.io/reference/api-tokens-and-client-keys#personal-access-tokens), or PAT. PATs are automatically scoped to the authenticated user.", "type": "object", @@ -5377,6 +5707,71 @@ "expiresAt" ] }, + "createStrategyVariantSchema": { + "description": "This is an experimental property. It may change or be removed as we work on it. Please don't depend on it yet. A strategy variant allows you to attach any data to strategies instead of only returning `true`/`false`. Strategy variants take precedence over feature variants.", + "type": "object", + "properties": { + "name": { + "description": "The variant name. Must be unique for this feature flag", + "type": "string", + "example": "blue_group" + }, + "weight": { + "description": "The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight) for more information", + "type": "integer", + "maximum": 1000, + "minimum": 0 + }, + "weightType": { + "description": "Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight).", + "type": "string", + "example": "fix", + "enum": [ + "variable", + "fix" + ] + }, + "stickiness": { + "description": "The [stickiness](https://docs.getunleash.io/reference/feature-toggle-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time", + "type": "string", + "example": "custom.context.field" + }, + "payload": { + "description": "Extra data configured for this variant", + "type": "object", + "example": { + "type": "json", + "value": "{\"color\": \"red\"}" + }, + "properties": { + "type": { + "description": "The type of the value. Commonly used types are string, number, json and csv.", + "type": "string", + "enum": [ + "json", + "csv", + "string", + "number" + ] + }, + "value": { + "description": "The actual value of payload", + "type": "string" + } + }, + "required": [ + "type", + "value" + ] + } + }, + "required": [ + "name", + "weight", + "weightType", + "stickiness" + ] + }, "createUserResponseSchema": { "description": "An Unleash user after creation", "type": "object", @@ -5638,6 +6033,27 @@ "environments" ] }, + "featureTypeCountSchema": { + "description": "A count of feature flags of a specific type", + "type": "object", + "properties": { + "type": { + "description": "Type of the flag e.g. experiment, kill-switch, release, operational, permission", + "type": "string", + "example": "kill-switch" + }, + "count": { + "description": "Number of feature flags of this type", + "type": "number", + "example": 1 + } + }, + "additionalProperties": true, + "required": [ + "type", + "count" + ] + }, "groupUserModelSchema": { "description": "Details for a single user belonging to a group", "type": "object", @@ -5683,6 +6099,13 @@ "value" ] }, + "parametersSchema": { + "description": "A list of parameters for a strategy", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "patSchema": { "description": "Describes a [personal access token](https://docs.getunleash.io/reference/api-tokens-and-client-keys#personal-access-tokens), or PAT. PATs are automatically scoped to the authenticated user.", "type": "object", @@ -5748,6 +6171,198 @@ } } }, + "projectEnvironmentSchema": { + "description": "Add an environment to a project, optionally also sets if change requests are enabled for this environment on the project", + "type": "object", + "properties": { + "environment": { + "description": "The environment to add to the project", + "type": "string", + "example": "development" + }, + "changeRequestsEnabled": { + "description": "Whether change requests should be enabled or for this environment on the project or not", + "type": "boolean", + "example": true + }, + "defaultStrategy": { + "description": "A default strategy to create for this environment on the project.", + "$ref": "#/components/schemas/createFeatureStrategySchema" + } + }, + "additionalProperties": true, + "required": [ + "environment" + ] + }, + "projectOverviewSchema": { + "description": "A high-level overview of a project. It contains information such as project statistics, the name of the project, what members and what features it contains, etc.", + "type": "object", + "properties": { + "stats": { + "description": "Project statistics", + "$ref": "#/components/schemas/projectStatsSchema" + }, + "version": { + "description": "The schema version used to describe the project overview", + "type": "integer", + "example": 1 + }, + "name": { + "description": "The name of this project", + "type": "string", + "example": "dx-squad" + }, + "description": { + "description": "Additional information about the project", + "type": "string", + "example": "DX squad feature release", + "nullable": true + }, + "defaultStickiness": { + "description": "A default stickiness for the project affecting the default stickiness value for variants and Gradual Rollout strategy", + "type": "string", + "example": "userId" + }, + "mode": { + "description": "The project's [collaboration mode](https://docs.getunleash.io/reference/project-collaboration-mode). Determines whether non-project members can submit change requests or not.", + "type": "string", + "example": "open", + "enum": [ + "open", + "protected", + "private" + ] + }, + "featureLimit": { + "description": "A limit on the number of features allowed in the project. Null if no limit.", + "type": "number", + "example": 100, + "nullable": true + }, + "featureNaming": { + "$ref": "#/components/schemas/createFeatureNamingPatternSchema" + }, + "members": { + "description": "The number of members this project has", + "type": "number", + "example": 4 + }, + "health": { + "description": "An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#project-status) on a scale from 0 to 100", + "type": "number", + "example": 50 + }, + "environments": { + "description": "The environments that are enabled for this project", + "type": "array", + "items": { + "$ref": "#/components/schemas/projectEnvironmentSchema" + }, + "example": [ + { + "environment": "development" + }, + { + "environment": "production", + "defaultStrategy": { + "name": "flexibleRollout", + "constraints": [], + "parameters": { + "groupId": "stickyFlag", + "rollout": "50", + "stickiness": "customAppName" + } + } + } + ] + }, + "featureTypeCounts": { + "description": "The number of features of each type that are in this project", + "type": "array", + "items": { + "$ref": "#/components/schemas/featureTypeCountSchema" + } + }, + "updatedAt": { + "description": "When the project was last updated.", + "type": "string", + "format": "date-time", + "example": "2023-02-10T08:36:35.262Z", + "nullable": true + }, + "archivedAt": { + "description": "When the project was archived.", + "type": "string", + "format": "date-time", + "example": "2023-02-10T08:36:35.262Z", + "nullable": true + }, + "createdAt": { + "description": "When the project was created.", + "type": "string", + "format": "date-time", + "example": "2023-02-10T08:36:35.262Z", + "nullable": true + }, + "favorite": { + "description": "`true` if the project was favorited, otherwise `false`.", + "type": "boolean", + "example": true + }, + "onboardingStatus": { + "description": "The current onboarding status of the project.", + "type": "object", + "oneOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "example": "onboarding-started", + "enum": [ + "onboarding-started", + "onboarded" + ] + } + }, + "required": [ + "status" + ], + "additionalProperties": true + }, + { + "type": "object", + "properties": { + "status": { + "type": "string", + "example": "first-flag-created", + "enum": [ + "first-flag-created" + ] + }, + "feature": { + "description": "The name of the feature flag", + "type": "string", + "example": "my-feature-flag" + } + }, + "required": [ + "status", + "feature" + ], + "additionalProperties": true + } + ] + } + }, + "additionalProperties": true, + "required": [ + "version", + "name", + "onboardingStatus" + ] + }, "projectSchema": { "description": "A definition of the project used for projects listing purposes", "type": "object", @@ -5786,6 +6401,63 @@ "name" ] }, + "projectStatsSchema": { + "description": "Statistics for a project, including the average time to production, number of features created, the project activity and more.\n\nStats are divided into current and previous **windows**.\n- The **current window** is the past 30 days.\n- The **previous window** is the 30 days **before** the current window (from 60 to 30 days ago)", + "type": "object", + "properties": { + "avgTimeToProdCurrentWindow": { + "description": "The average time from when a feature was created to when it was enabled in the \"production\" environment during the current window", + "type": "number", + "example": 10 + }, + "createdCurrentWindow": { + "description": "The number of feature flags created during the current window", + "type": "number", + "example": 15 + }, + "createdPastWindow": { + "description": "The number of feature flags created during the previous window", + "type": "number", + "example": 15 + }, + "archivedCurrentWindow": { + "description": "The number of feature flags that were archived during the current window", + "type": "number", + "example": 5 + }, + "archivedPastWindow": { + "description": "The number of feature flags that were archived during the previous window", + "type": "number", + "example": 5 + }, + "projectActivityCurrentWindow": { + "description": "The number of project events that occurred during the current window", + "type": "number", + "example": 100 + }, + "projectActivityPastWindow": { + "description": "The number of project events that occurred during the previous window", + "type": "number", + "example": 100 + }, + "projectMembersAddedCurrentWindow": { + "description": "The number of members that were added to the project during the current window", + "type": "number", + "example": 1 + } + }, + "additionalProperties": true, + "required": [ + "avgTimeToProdCurrentWindow", + "createdCurrentWindow", + "createdPastWindow", + "archivedCurrentWindow", + "archivedPastWindow", + "projectActivityCurrentWindow", + "projectActivityPastWindow", + "projectMembersAddedCurrentWindow" + ] + }, "projectsSchema": { "description": "An overview of all the projects in the Unleash instance", "type": "object", @@ -6980,6 +7652,66 @@ } ] }, + "changeRequestConfigSchema": { + "description": "A list of environment-specific [change request](https://docs.getunleash.io/reference/change-requests) configurations.", + "type": "array", + "items": { + "$ref": "#/components/schemas/changeRequestEnvironmentConfigSchema" + } + }, + "changeRequestEnvironmentConfigSchema": { + "description": "The [change request](https://docs.getunleash.io/reference/change-requests) configuration for a specific environment.", + "type": "object", + "properties": { + "environment": { + "description": "The environment that this configuration applies to.", + "type": "string", + "example": "my-dev-environment" + }, + "type": { + "description": "The [type of the environment](https://docs.getunleash.io/reference/environments#environment-types) listed in `environment`.", + "type": "string", + "example": "development" + }, + "changeRequestEnabled": { + "description": "`true` if this environment has change requests enabled, otherwise `false`.", + "type": "boolean", + "example": true + }, + "requiredApprovals": { + "description": "The number of approvals that are required for a change request to be fully approved and ready to be applied in this environment.", + "type": "number", + "example": 2, + "nullable": true + } + }, + "additionalProperties": true, + "required": [ + "environment", + "type", + "changeRequestEnabled", + "requiredApprovals" + ] + }, + "updateChangeRequestEnvironmentConfigSchema": { + "description": "Data used to update change request in an environment", + "type": "object", + "properties": { + "changeRequestsEnabled": { + "description": "`true` if change requests should be enabled, otherwise `false`.", + "type": "boolean" + }, + "requiredApprovals": { + "description": "The number of approvals required before a change request can be applied in this environment.", + "type": "integer", + "example": 3, + "minimum": 0 + } + }, + "required": [ + "changeRequestsEnabled" + ] + }, "updateEnvironmentSchema": { "description": "Data used to update an [environment](https://docs.getunleash.io/reference/environments).", "type": "object", diff --git a/openapi.json b/openapi.json index 5b9b4f1..e090dcb 100644 --- a/openapi.json +++ b/openapi.json @@ -25710,6 +25710,33 @@ } } } + }, + "409": { + "description": "The provided resource can not be created or updated because it would conflict with the current state of the resource or with an already existing resource, respectively.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "9c40958a-daac-400e-98fb-3bb438567008", + "description": "The ID of the error instance" + }, + "name": { + "type": "string", + "example": "NameExistsError", + "description": "The name of the error kind" + }, + "message": { + "type": "string", + "example": "There is already a feature called \"my-awesome-feature\".", + "description": "A description of what went wrong." + } + } + } + } + } } } } @@ -25913,6 +25940,33 @@ } } } + }, + "409": { + "description": "The provided resource can not be created or updated because it would conflict with the current state of the resource or with an already existing resource, respectively.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "9c40958a-daac-400e-98fb-3bb438567008", + "description": "The ID of the error instance" + }, + "name": { + "type": "string", + "example": "NameExistsError", + "description": "The name of the error kind" + }, + "message": { + "type": "string", + "example": "There is already a feature called \"my-awesome-feature\".", + "description": "A description of what went wrong." + } + } + } + } + } } }, "parameters": [ @@ -30032,10 +30086,10 @@ "tags": [ "Metrics" ], - "deprecated": false, + "deprecated": true, "operationId": "getTrafficUsageDataForPeriod", "summary": "Gets traffic usage data for selected period", - "description": "Gets traffic usage data numbers per API for a period given by the parameter", + "description": "Gets traffic usage data numbers per API for a period given by the parameter. This endpoint is deprecated. Use /traffic-search instead", "responses": { "200": { "description": "trafficUsageDataSegmentedSchema", @@ -33746,8 +33800,8 @@ "Metrics" ], "operationId": "getApplicationEnvironmentInstances", - "summary": "Get application environment instances", - "description": "Returns an overview of the instances for the given `appName` and `environment` that receive traffic.", + "summary": "Get application environment instances (Last 24h)", + "description": "Returns an overview of the instances for the given `appName` and `environment` that have received traffic in the last 24 hours.", "responses": { "200": { "description": "applicationEnvironmentInstancesSchema", diff --git a/operations.yaml b/operations.yaml index eee3fd0..cd230d9 100644 --- a/operations.yaml +++ b/operations.yaml @@ -23,6 +23,7 @@ inverseOperationIds: - createProject - updateProject - deleteProject + - getProjectOverview - getPermissions - getProjectAccess @@ -65,3 +66,6 @@ inverseOperationIds: - getAllEnvironments - toggleEnvironmentOff - toggleEnvironmentOn + + - getProjectChangeRequestConfig + - updateProjectChangeRequestConfig \ No newline at end of file diff --git a/test/api_change_request_config_test.go b/test/api_change_request_config_test.go new file mode 100644 index 0000000..1688c20 --- /dev/null +++ b/test/api_change_request_config_test.go @@ -0,0 +1,71 @@ +package client + +import ( + "context" + "fmt" + "testing" + + "github.com/Unleash/unleash-server-api-go/client" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func resetDefaultConfig(apiClient *client.APIClient, project, environment string) { + enableChangeRequest := *client.NewUpdateChangeRequestEnvironmentConfigSchemaWithDefaults() + enableChangeRequest.ChangeRequestsEnabled = false + + apiClient.ChangeRequestsAPI.UpdateProjectChangeRequestConfig(context.Background(), project, environment).UpdateChangeRequestEnvironmentConfigSchema(enableChangeRequest).Execute() +} + +func Test_client_ChangeRequestService(t *testing.T) { + apiClient := testClient() + + if !enterpriseEnvironmentAvailable() { + t.Skip("Enterprise only feature") + return + } + + t.Run("Test ChangeRequestAPIService EnableChangeRequest", func(t *testing.T) { + project := "default" + environment := "production" + + var config, httpRes, err = apiClient.ChangeRequestsAPI.GetProjectChangeRequestConfig(context.Background(), project).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + require.NotNil(t, config) + require.NotNil(t, config[1]) + + require.Equal(t, config[1].RequiredApprovals, *client.NewNullableFloat32(nil)) + require.Equal(t, config[1].Type, "production") + require.Equal(t, config[1].Environment, "production") + require.Equal(t, config[1].ChangeRequestEnabled, false) + + enableChangeRequest := *client.NewUpdateChangeRequestEnvironmentConfigSchemaWithDefaults() + enableChangeRequest.ChangeRequestsEnabled = true + enableChangeRequest.SetRequiredApprovals(2) + + httpRes, err = apiClient.ChangeRequestsAPI.UpdateProjectChangeRequestConfig(context.Background(), project, environment).UpdateChangeRequestEnvironmentConfigSchema(enableChangeRequest).Execute() + defer resetDefaultConfig(apiClient, project, environment) + + if err != nil { + fmt.Println(err) + } + + require.Nil(t, err) + assert.Equal(t, 204, httpRes.StatusCode) + + config, httpRes, err = apiClient.ChangeRequestsAPI.GetProjectChangeRequestConfig(context.Background(), project).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + require.NotNil(t, config) + require.NotNil(t, config[1]) + + requiredApprovals := float32(2) + require.Equal(t, config[1].RequiredApprovals, *client.NewNullableFloat32(&requiredApprovals)) + require.Equal(t, config[1].Type, "production") + require.Equal(t, config[1].Environment, "production") + require.Equal(t, config[1].ChangeRequestEnabled, true) + }) +} diff --git a/test/api_projects_test.go b/test/api_projects_test.go index 205fbc6..0e195b4 100644 --- a/test/api_projects_test.go +++ b/test/api_projects_test.go @@ -33,7 +33,9 @@ func createTempUser(t *testing.T, apiClient *client.APIClient, prefix string) *c resp, httpRes, err := apiClient.UsersAPI.CreateUser(context.Background()).CreateUserSchema(createUserSchema).Execute() - fmt.Println(err) + if err != nil { + fmt.Println(err) + } require.Nil(t, err) require.NotNil(t, resp) assert.Equal(t, 201, httpRes.StatusCode) @@ -118,7 +120,9 @@ func Test_client_ProjectsAPIService(t *testing.T) { resp, httpRes, err := apiClient.ProjectsAPI.GetProjectAccess(context.Background(), projectId).Execute() - fmt.Println(err) + if err != nil { + fmt.Println(err) + } require.Nil(t, err) require.NotNil(t, resp) @@ -211,4 +215,35 @@ func Test_client_ProjectsAPIService(t *testing.T) { t.Skip("Enterprise only feature") } }) + + t.Run("Test ProjectsAPIService Create Project with empty list of environments", func(t *testing.T) { + if enterpriseEnvironmentAvailable() { + projectId := "petfood-shop-project" + createProjectSchema := *client.NewCreateProjectSchema("some-random-project") + createProjectSchema.SetId(projectId) + createProjectSchema.Environments = []string{} + + resp, httpRes, err := apiClient.ProjectsAPI.CreateProject(context.Background()).CreateProjectSchema(createProjectSchema).Execute() + + if err != nil { + fmt.Println(err) + } + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 201, httpRes.StatusCode) + + defer cleanupProject(t, apiClient, projectId) + + project, projectApiResponse, err := apiClient.ProjectsAPI.GetProjectOverview(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, projectApiResponse) + require.NotNil(t, project) + assert.Equal(t, 0, len(project.Environments)) + + } else { + t.Skip("Enterprise only feature") + } + }) }