Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ NO_CLIENT_GD_PROJECTS_ABS = $(filter-out %client, $(wildcard $(CURDIR)/packages/
NO_CLIENT_GD_PROJECTS_DIRS = $(foreach dir, $(NO_CLIENT_GD_PROJECTS_ABS), $(notdir $(dir)))
# TODO: replace API_VERSION in the future by call to API
API_VERSION="v1"
# Default: generate from localhost; use `make api-client STAGING=1` to download from remote
# Default: generate from localhost; use `make api-client STAGING=1` to download from staging
ifdef STAGING
BASE_URL="https://demo-cicd.cloud.gooddata.com"
BASE_URL="https://staging.dev-latest.stg11.panther.intgdc.com"
else
BASE_URL="http://localhost:3000"
endif
Expand Down Expand Up @@ -61,22 +61,8 @@ endef
.PHONY: _api-client-generate
_api-client-generate:
rm -f schemas/gooddata-api-client.json
# Merge per-domain specs and strip literal NUL bytes that jq decoded from
# escapes in the source (the previous `sed '/.../d'` pattern was a no-op:
# sed BRE/ERE doesn't interpret \uNNNN, so it never matched anything).
cat schemas/gooddata-*.json | jq -S -s 'reduce .[] as $$item ({}; . * $$item) + { tags : ( reduce .[].tags as $$item (null; . + $$item) | unique_by(.name) ) }' | tr -d '\000' > "schemas/gooddata-api-client.json"
# Break the DashboardCompoundConditionItem ↔ children oneOf/allOf cycle that
# crashes openapi-generator-cli v6.6.0 with StackOverflowError in
# recursiveGetDiscriminator (its walker has no visited-set). Parent has no
# own properties, so dropping the redundant `allOf: [{$$ref: parent}]` from
# each child is semantically a no-op.
jq '(.components.schemas.DashboardCompoundComparisonCondition.allOf) |= map(select(.["$$ref"] != "#/components/schemas/DashboardCompoundConditionItem")) | (.components.schemas.DashboardCompoundRangeCondition.allOf) |= map(select(.["$$ref"] != "#/components/schemas/DashboardCompoundConditionItem"))' schemas/gooddata-api-client.json > schemas/gooddata-api-client.json.tmp && mv schemas/gooddata-api-client.json.tmp schemas/gooddata-api-client.json
cat schemas/gooddata-*.json | jq -S -s 'reduce .[] as $$item ({}; . * $$item) + { tags : ( reduce .[].tags as $$item (null; . + $$item) | unique_by(.name) ) }' > "schemas/gooddata-api-client.json"
$(call generate_client,api)
# Repair regex patterns of the form ^[^\x00]*$ that openapi-generator mangles
# in two ways: sometimes it drops the NUL (leaving the invalid `^[^]*$`),
# sometimes it embeds a literal NUL byte (producing a Python source that
# fails to import with SyntaxError). The helper handles both shapes.
./scripts/postprocess_api_client.py gooddata-api-client/gooddata_api_client

.PHONY: api-client
api-client: download _api-client-generate
Expand Down
2 changes: 2 additions & 0 deletions gooddata-api-client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ docs/DeclarativeFilterContext.md
docs/DeclarativeFilterView.md
docs/DeclarativeIdentityProvider.md
docs/DeclarativeIdentityProviderIdentifier.md
docs/DeclarativeIpAllowlistPolicy.md
docs/DeclarativeJwk.md
docs/DeclarativeJwkSpecification.md
docs/DeclarativeLabel.md
Expand Down Expand Up @@ -1831,6 +1832,7 @@ gooddata_api_client/model/declarative_filter_context.py
gooddata_api_client/model/declarative_filter_view.py
gooddata_api_client/model/declarative_identity_provider.py
gooddata_api_client/model/declarative_identity_provider_identifier.py
gooddata_api_client/model/declarative_ip_allowlist_policy.py
gooddata_api_client/model/declarative_jwk.py
gooddata_api_client/model/declarative_jwk_specification.py
gooddata_api_client/model/declarative_label.py
Expand Down
1 change: 1 addition & 0 deletions gooddata-api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,7 @@ Class | Method | HTTP request | Description
- [DeclarativeFilterView](docs/DeclarativeFilterView.md)
- [DeclarativeIdentityProvider](docs/DeclarativeIdentityProvider.md)
- [DeclarativeIdentityProviderIdentifier](docs/DeclarativeIdentityProviderIdentifier.md)
- [DeclarativeIpAllowlistPolicy](docs/DeclarativeIpAllowlistPolicy.md)
- [DeclarativeJwk](docs/DeclarativeJwk.md)
- [DeclarativeJwkSpecification](docs/DeclarativeJwkSpecification.md)
- [DeclarativeLabel](docs/DeclarativeLabel.md)
Expand Down
2 changes: 1 addition & 1 deletion gooddata-api-client/docs/DeclarativeColumn.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A table column.
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data_type** | **str** | Column type |
**name** | **str** | Column name |
**name** | **str** | Column name. Must not contain NUL (0x00) characters. |
**description** | **str** | Column description/comment from database | [optional]
**is_nullable** | **bool** | Column is nullable | [optional]
**is_primary_key** | **bool** | Is column part of primary key? | [optional]
Expand Down
16 changes: 16 additions & 0 deletions gooddata-api-client/docs/DeclarativeIpAllowlistPolicy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# DeclarativeIpAllowlistPolicy

A declarative form of an IP allowlist policy.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**allowed_sources** | **[str]** | Allowed source IP addresses or CIDR ranges. |
**id** | **str** | Identifier of an IP allowlist policy. |
**user_groups** | [**[DeclarativeUserGroupIdentifier]**](DeclarativeUserGroupIdentifier.md) | Target user groups this policy applies to. | [optional]
**users** | [**[DeclarativeUserIdentifier]**](DeclarativeUserIdentifier.md) | Target users this policy applies to. | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions gooddata-api-client/docs/DeclarativeOrganization.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Name | Type | Description | Notes
**data_sources** | [**[DeclarativeDataSource]**](DeclarativeDataSource.md) | | [optional]
**export_templates** | [**[DeclarativeExportTemplate]**](DeclarativeExportTemplate.md) | | [optional]
**identity_providers** | [**[DeclarativeIdentityProvider]**](DeclarativeIdentityProvider.md) | | [optional]
**ip_allowlist_policies** | [**[DeclarativeIpAllowlistPolicy]**](DeclarativeIpAllowlistPolicy.md) | | [optional]
**jwks** | [**[DeclarativeJwk]**](DeclarativeJwk.md) | | [optional]
**notification_channels** | [**[DeclarativeNotificationChannel]**](DeclarativeNotificationChannel.md) | | [optional]
**user_groups** | [**[DeclarativeUserGroup]**](DeclarativeUserGroup.md) | | [optional]
Expand Down
18 changes: 18 additions & 0 deletions gooddata-api-client/docs/LayoutApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4435,6 +4435,24 @@ with gooddata_api_client.ApiClient() as api_client:
saml_metadata="saml_metadata_example",
),
],
ip_allowlist_policies=[
DeclarativeIpAllowlistPolicy(
allowed_sources=["203.0.113.10/32","198.51.100.0/24"],
id="admin-vpn-only",
user_groups=[
DeclarativeUserGroupIdentifier(
id="group.admins",
type="userGroup",
),
],
users=[
DeclarativeUserIdentifier(
id="employee123",
type="user",
),
],
),
],
jwks=[
DeclarativeJwk(
content=DeclarativeJwkSpecification(),
Expand Down
18 changes: 18 additions & 0 deletions gooddata-api-client/docs/OrganizationDeclarativeAPIsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,24 @@ with gooddata_api_client.ApiClient() as api_client:
saml_metadata="saml_metadata_example",
),
],
ip_allowlist_policies=[
DeclarativeIpAllowlistPolicy(
allowed_sources=["203.0.113.10/32","198.51.100.0/24"],
id="admin-vpn-only",
user_groups=[
DeclarativeUserGroupIdentifier(
id="group.admins",
type="userGroup",
),
],
users=[
DeclarativeUserIdentifier(
id="employee123",
type="user",
),
],
),
],
jwks=[
DeclarativeJwk(
content=DeclarativeJwkSpecification(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ class DeclarativeColumn(ModelNormal):
validations = {
('name',): {
'max_length': 255,
'regex': {
'pattern': r'^[^\x00]*$', # noqa: E501
},
},
('description',): {
'max_length': 10000,
Expand Down Expand Up @@ -143,7 +140,7 @@ def _from_openapi_data(cls, data_type, name, *args, **kwargs): # noqa: E501

Args:
data_type (str): Column type
name (str): Column name
name (str): Column name. Must not contain NUL (0x00) characters.

Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
Expand Down Expand Up @@ -239,7 +236,7 @@ def __init__(self, data_type, name, *args, **kwargs): # noqa: E501

Args:
data_type (str): Column type
name (str): Column name
name (str): Column name. Must not contain NUL (0x00) characters.

Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
Expand Down
Loading
Loading