diff --git a/.github/workflows/codegen-ci.yml b/.github/workflows/codegen-ci.yml index f0cb3ba65..88fc9beb1 100644 --- a/.github/workflows/codegen-ci.yml +++ b/.github/workflows/codegen-ci.yml @@ -20,8 +20,8 @@ env: LOOKERSDK_BASE_URL: https://localhost:20000 LOOKERSDK_VERIFY_SSL: false TS_JUNIT_OUTPUT_DIR: results/sdk-codegen - LOOKERSDK_CLIENT_ID: ${{ secrets.LOOKERSDK_CLIENT_ID__21_16 }} - LOOKERSDK_CLIENT_SECRET: ${{ secrets.LOOKERSDK_CLIENT_SECRET__21_16 }} + LOOKERSDK_CLIENT_ID: ${{ secrets.LOOKERSDK_CLIENT_ID__21_18 }} + LOOKERSDK_CLIENT_SECRET: ${{ secrets.LOOKERSDK_CLIENT_SECRET__21_18 }} jobs: unit: @@ -79,9 +79,9 @@ jobs: # TODO: can we cache some layers of the image for faster download? # we probably don't want to cache the final image for IP security... run: | - docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_16 + docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_18 # set $LOOKER_OPTS to --no-ssl if we want to turn off ssl - docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_16 + docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_18 docker logs -f looker-sdk-codegen-ci --until=30s & python ${{ github.workspace }}/.github/scripts/wait_for_looker.py diff --git a/.github/workflows/lerna-publish.yml b/.github/workflows/lerna-publish.yml index faa32982b..b6436fc26 100644 --- a/.github/workflows/lerna-publish.yml +++ b/.github/workflows/lerna-publish.yml @@ -21,8 +21,8 @@ jobs: env: LOOKERSDK_BASE_URL: https://localhost:20000 LOOKERSDK_VERIFY_SSL: false - LOOKERSDK_CLIENT_ID: ${{ secrets.LOOKERSDK_CLIENT_ID__21_16 }} - LOOKERSDK_CLIENT_SECRET: ${{ secrets.LOOKERSDK_CLIENT_SECRET__21_16 }} + LOOKERSDK_CLIENT_ID: ${{ secrets.LOOKERSDK_CLIENT_ID__21_18 }} + LOOKERSDK_CLIENT_SECRET: ${{ secrets.LOOKERSDK_CLIENT_SECRET__21_18 }} steps: - name: Clone repository uses: actions/checkout@v2 @@ -70,8 +70,8 @@ jobs: - name: Pull and run Looker docker image run: | - docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_16 - docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_16 + docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_18 + docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_18 docker logs -f looker-sdk-codegen-ci --until=30s & python ${{ github.workspace }}/.github/scripts/wait_for_looker.py diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index ad29bb64e..daf376f2d 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -95,8 +95,8 @@ jobs: - ubuntu looker: - '21_12' - - '21_14' - '21_16' + - '21_18' # TODO uncomment `include:` when either macos or windows works to satisfaction. #include: # TODO: macos matrix leg is functional but it takes ~20 minutes (compared diff --git a/.github/workflows/tssdk-ci.yml b/.github/workflows/tssdk-ci.yml index 40e21b751..937c35fa1 100644 --- a/.github/workflows/tssdk-ci.yml +++ b/.github/workflows/tssdk-ci.yml @@ -100,8 +100,8 @@ jobs: - ubuntu looker: - '21_12' - - '21_14' - '21_16' + - '21_18' steps: - name: Repo Checkout diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 614c1db75..c165dcc9d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,5 @@ { - ".": "1.16.0", + ".": "1.18.0", "packages/api-explorer": "0.9.20", "packages/code-editor": "0.1.11", "packages/extension-api-explorer": "21.16.0", diff --git a/csharp/rtl/Constants.cs b/csharp/rtl/Constants.cs index e01d8b6a0..36c3dfa58 100644 --- a/csharp/rtl/Constants.cs +++ b/csharp/rtl/Constants.cs @@ -61,7 +61,7 @@ public struct Constants public const string DefaultApiVersion = "4.0"; public const string AgentPrefix = "CS-SDK"; - public const string LookerVersion = "21.16"; + public const string LookerVersion = "21.18"; public const string Bearer = "Bearer"; public const string LookerAppiId = "x-looker-appid"; diff --git a/csharp/sdk/3.1/models.cs b/csharp/sdk/3.1/models.cs index a45325815..1f3a32d91 100644 --- a/csharp/sdk/3.1/models.cs +++ b/csharp/sdk/3.1/models.cs @@ -775,6 +775,14 @@ public class Dashboard : SdkModel public DateTime? last_accessed_at { get; set; } = null; /// Time last viewed in the Looker web UI (read-only) public DateTime? last_viewed_at { get; set; } = null; + /// Time that the Dashboard was most recently updated. (read-only) + public DateTime? updated_at { get; set; } = null; + /// Id of User that most recently updated the dashboard. (read-only) + public long? last_updater_id { get; set; } = null; + /// Name of User that most recently updated the dashboard. (read-only) + public string? last_updater_name { get; set; } = null; + /// Name of User that created the dashboard. (read-only) + public string? user_name { get; set; } = null; /// configuration option that governs how dashboard loading will happen. public string? load_configuration { get; set; } = null; /// Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match. @@ -3313,6 +3321,8 @@ public class RenderTask : SdkModel public string? lookml_dashboard_id { get; set; } = null; /// Id of query to render (read-only) public long? query_id { get; set; } = null; + /// Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id (read-only) + public string? dashboard_element_id { get; set; } = null; /// Number of seconds elapsed running queries (read-only) public double? query_runtime { get; set; } = null; /// Number of seconds elapsed rendering data (read-only) @@ -4495,7 +4505,7 @@ public class WriteCustomWelcomeEmail : SdkModel } /// Dynamic writeable type for Dashboard removes: -/// can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count +/// can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count public class WriteDashboard : SdkModel { /// Description diff --git a/csharp/sdk/4.0/methods.cs b/csharp/sdk/4.0/methods.cs index 3d8935927..d8aa24495 100644 --- a/csharp/sdk/4.0/methods.cs +++ b/csharp/sdk/4.0/methods.cs @@ -115,7 +115,7 @@ public async Task> update_alert( } /// ### Update select alert fields - /// # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + /// # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` /// # /// /// PATCH /alerts/{alert_id} -> Alert @@ -125,7 +125,7 @@ public async Task> update_alert( /// ID of an alert public async Task> update_alert_field( long alert_id, - WriteAlert body, + AlertPatch body, ITransportSettings? options = null) { return await AuthRequest(HttpMethod.Patch, $"/alerts/{alert_id}", null,body,options); diff --git a/csharp/sdk/4.0/models.cs b/csharp/sdk/4.0/models.cs index 75fedbbdb..81c7c1f35 100644 --- a/csharp/sdk/4.0/models.cs +++ b/csharp/sdk/4.0/models.cs @@ -21,7 +21,7 @@ /// SOFTWARE. /// -/// 297 API models: 220 Spec, 0 Request, 57 Write, 20 Enum +/// 298 API models: 221 Spec, 0 Request, 57 Write, 20 Enum #nullable enable using System; @@ -57,9 +57,9 @@ public class Alert : SdkModel public AlertAppliedDashboardFilter[]? applied_dashboard_filters { get; set; } = null; /// This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". [JsonConverter(typeof(StringEnumConverter))] - public ComparisonType? comparison_type { get; set; } + public ComparisonType comparison_type { get; set; } /// Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals - public string? cron { get; set; } = null; + public string cron { get; set; } = ""; /// An optional, user-defined title for the alert public string? custom_title { get; set; } = null; /// ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement) @@ -67,8 +67,8 @@ public class Alert : SdkModel /// An optional description for the alert. This supplements the title public string? description { get; set; } = null; /// Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` - public AlertDestination[]? destinations { get; set; } = null; - public AlertField? field { get; set; } + public AlertDestination[] destinations { get; set; } = null; + public AlertField field { get; set; } = null; /// Whether or not the user follows this alert. (read-only) public bool? followed { get; set; } = null; /// Whether or not the alert is followable (read-only) @@ -77,6 +77,8 @@ public class Alert : SdkModel public long? id { get; set; } = null; /// Whether or not the alert is disabled public bool? is_disabled { get; set; } = null; + /// Reason for disabling alert + public string? disabled_reason { get; set; } = null; /// Whether or not the alert is public public bool? is_public { get; set; } = null; /// The type of the investigative content Valid values are: "dashboard". @@ -91,22 +93,22 @@ public class Alert : SdkModel /// ID of the LookML dashboard element associated with the alert public string? lookml_link_id { get; set; } = null; /// User id of alert owner - public long? owner_id { get; set; } = null; + public long owner_id { get; set; } /// Alert owner's display name (read-only) public string? owner_display_name { get; set; } = null; /// Value of the alert threshold - public double? threshold { get; set; } = null; + public double threshold { get; set; } public AlertConditionState? time_series_condition_state { get; set; } } public class AlertAppliedDashboardFilter : SdkModel { /// Field Title. Refer to `DashboardFilter.title` in [DashboardFilter](#!/types/DashboardFilter). Example `Name` - public string? filter_title { get; set; } = null; + public string filter_title { get; set; } = ""; /// Field Name. Refer to `DashboardFilter.dimension` in [DashboardFilter](#!/types/DashboardFilter). Example `distribution_centers.name` - public string? field_name { get; set; } = null; + public string field_name { get; set; } = ""; /// Field Value. [Filter Expressions](https://docs.looker.com/reference/filter-expressions). Example `Los Angeles CA` - public string? filter_value { get; set; } = null; + public string filter_value { get; set; } = ""; /// Human Readable Filter Description. This may be null or auto-generated. Example `is Los Angeles CA` (read-only) public string? filter_description { get; set; } = null; } @@ -135,9 +137,9 @@ public class AlertDestination : SdkModel public class AlertField : SdkModel { /// Field's title. Usually auto-generated to reflect field name and its filters - public string? title { get; set; } = null; + public string title { get; set; } = ""; /// Field's name. Has the format `.` Refer to [docs](https://docs.looker.com/sharing-and-publishing/creating-alerts) for more details - public string? name { get; set; } = null; + public string name { get; set; } = ""; /// (Optional / Advance Use) List of fields filter. This further restricts the alert to certain dashboard element's field values. This can be used on top of dashboard filters `applied_dashboard_filters`. To keep thing simple, it's suggested to just use dashboard filters. Example: `{ 'title': '12 Number on Hand', 'name': 'inventory_items.number_on_hand', 'filter': [{ 'field_name': 'inventory_items.id', 'field_value': 12, 'filter_value': null }] }` public AlertFieldFilter[]? filter { get; set; } = null; } @@ -145,13 +147,27 @@ public class AlertField : SdkModel public class AlertFieldFilter : SdkModel { /// Field Name. Has format `.` - public string? field_name { get; set; } = null; + public string field_name { get; set; } = ""; /// Field Value. Depends on the type of field - numeric or string. For [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type, it's a list of floats. Example `[1.0, 56.0]` - public object? field_value { get; set; } = null; + public object field_value { get; set; } = null; /// Filter Value. Usually null except for [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type. It'll be a string of lat,long ie `'1.0,56.0'` public string? filter_value { get; set; } = null; } +public class AlertPatch : SdkModel +{ + /// New owner ID of the alert + public long? owner_id { get; set; } = null; + /// Set alert enabled or disabled + public bool? is_disabled { get; set; } = null; + /// The reason this alert is disabled + public string? disabled_reason { get; set; } = null; + /// Set alert public or private + public bool? is_public { get; set; } = null; + /// New threshold value + public double? threshold { get; set; } = null; +} + /// The appropriate horizontal text alignment the values of this field should be displayed in. Valid values are: "left", "right". public enum Align { @@ -1110,6 +1126,14 @@ public class Dashboard : SdkModel public DateTime? last_accessed_at { get; set; } = null; /// Time last viewed in the Looker web UI (read-only) public DateTime? last_viewed_at { get; set; } = null; + /// Time that the Dashboard was most recently updated. (read-only) + public DateTime? updated_at { get; set; } = null; + /// Id of User that most recently updated the dashboard. (read-only) + public long? last_updater_id { get; set; } = null; + /// Name of User that most recently updated the dashboard. (read-only) + public string? last_updater_name { get; set; } = null; + /// Name of User that created the dashboard. (read-only) + public string? user_name { get; set; } = null; /// configuration option that governs how dashboard loading will happen. public string? load_configuration { get; set; } = null; /// Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match. @@ -1452,7 +1476,7 @@ public class DBConnection : SdkModel /// Host name/address of server public string? host { get; set; } = null; /// Port number on server - public long? port { get; set; } = null; + public string? port { get; set; } = null; /// Username for server authentication public string? username { get; set; } = null; /// (Write-Only) Password for server authentication @@ -3782,6 +3806,8 @@ public class RenderTask : SdkModel public string? lookml_dashboard_id { get; set; } = null; /// Id of query to render (read-only) public long? query_id { get; set; } = null; + /// Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id (read-only) + public string? dashboard_element_id { get; set; } = null; /// Number of seconds elapsed running queries (read-only) public double? query_runtime { get; set; } = null; /// Number of seconds elapsed rendering data (read-only) @@ -4909,9 +4935,9 @@ public class WriteAlert : SdkModel public AlertAppliedDashboardFilter[]? applied_dashboard_filters { get; set; } = null; /// This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". [JsonConverter(typeof(StringEnumConverter))] - public ComparisonType? comparison_type { get; set; } + public ComparisonType comparison_type { get; set; } /// Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals - public string? cron { get; set; } = null; + public string cron { get; set; } = ""; /// An optional, user-defined title for the alert public string? custom_title { get; set; } = null; /// ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement) @@ -4919,10 +4945,12 @@ public class WriteAlert : SdkModel /// An optional description for the alert. This supplements the title public string? description { get; set; } = null; /// Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` - public AlertDestination[]? destinations { get; set; } = null; - public AlertField? field { get; set; } + public AlertDestination[] destinations { get; set; } = null; + public AlertField field { get; set; } = null; /// Whether or not the alert is disabled public bool? is_disabled { get; set; } = null; + /// Reason for disabling alert + public string? disabled_reason { get; set; } = null; /// Whether or not the alert is public public bool? is_public { get; set; } = null; /// The type of the investigative content Valid values are: "dashboard". @@ -4935,9 +4963,9 @@ public class WriteAlert : SdkModel /// ID of the LookML dashboard element associated with the alert public string? lookml_link_id { get; set; } = null; /// User id of alert owner - public long? owner_id { get; set; } = null; + public long owner_id { get; set; } /// Value of the alert threshold - public double? threshold { get; set; } = null; + public double threshold { get; set; } public AlertConditionState? time_series_condition_state { get; set; } } @@ -5136,7 +5164,7 @@ public class WriteCredentialsEmail : SdkModel } /// Dynamic writeable type for Dashboard removes: -/// can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count, url +/// can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count, url public class WriteDashboard : SdkModel { /// Description @@ -5334,7 +5362,7 @@ public class WriteDBConnection : SdkModel /// Host name/address of server public string? host { get; set; } = null; /// Port number on server - public long? port { get; set; } = null; + public string? port { get; set; } = null; /// Username for server authentication public string? username { get; set; } = null; /// (Write-Only) Password for server authentication diff --git a/go/sdk/v3/models.go b/go/sdk/v3/models.go index ace12f2f0..f6fdb7838 100644 --- a/go/sdk/v3/models.go +++ b/go/sdk/v3/models.go @@ -497,6 +497,10 @@ type Dashboard struct { FiltersBarCollapsed *bool `json:"filters_bar_collapsed,omitempty"` // Sets the default state of the filters bar to collapsed or open LastAccessedAt *time.Time `json:"last_accessed_at,omitempty"` // Time the dashboard was last accessed LastViewedAt *time.Time `json:"last_viewed_at,omitempty"` // Time last viewed in the Looker web UI + UpdatedAt *time.Time `json:"updated_at,omitempty"` // Time that the Dashboard was most recently updated. + LastUpdaterId *int64 `json:"last_updater_id,omitempty"` // Id of User that most recently updated the dashboard. + LastUpdaterName *string `json:"last_updater_name,omitempty"` // Name of User that most recently updated the dashboard. + UserName *string `json:"user_name,omitempty"` // Name of User that created the dashboard. LoadConfiguration *string `json:"load_configuration,omitempty"` // configuration option that governs how dashboard loading will happen. LookmlLinkId *string `json:"lookml_link_id,omitempty"` // Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match. ShowFiltersBar *bool `json:"show_filters_bar,omitempty"` // Show filters bar. **Security Note:** This property only affects the *cosmetic* appearance of the dashboard, not a user's ability to access data. Hiding the filters bar does **NOT** prevent users from changing filters by other means. For information on how to set up secure data access control policies, see [Control User Access to Data](https://looker.com/docs/r/api/control-access) @@ -1989,25 +1993,26 @@ type QueryTask struct { type RenderTask struct { - Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object - CreatedAt *string `json:"created_at,omitempty"` // Date/Time render task was created - DashboardFilters *string `json:"dashboard_filters,omitempty"` // Filter values to apply to the dashboard queries, in URL query format - DashboardId *int64 `json:"dashboard_id,omitempty"` // Id of dashboard to render - DashboardStyle *string `json:"dashboard_style,omitempty"` // Dashboard layout style: single_column or tiled - FinalizedAt *string `json:"finalized_at,omitempty"` // Date/Time render task was completed - Height *int64 `json:"height,omitempty"` // Output height in pixels. Flowed layouts may ignore this value. - Id *string `json:"id,omitempty"` // Id of this render task - LookId *int64 `json:"look_id,omitempty"` // Id of look to render - LookmlDashboardId *string `json:"lookml_dashboard_id,omitempty"` // Id of lookml dashboard to render - QueryId *int64 `json:"query_id,omitempty"` // Id of query to render - QueryRuntime *float64 `json:"query_runtime,omitempty"` // Number of seconds elapsed running queries - RenderRuntime *float64 `json:"render_runtime,omitempty"` // Number of seconds elapsed rendering data - ResultFormat *string `json:"result_format,omitempty"` // Output format: pdf, png, or jpg - Runtime *float64 `json:"runtime,omitempty"` // Total seconds elapsed for render task - Status *string `json:"status,omitempty"` // Render task status: enqueued_for_query, querying, enqueued_for_render, rendering, success, failure - StatusDetail *string `json:"status_detail,omitempty"` // Additional information about the current status - UserId *int64 `json:"user_id,omitempty"` // The user account permissions in which the render task will execute - Width *int64 `json:"width,omitempty"` // Output width in pixels + Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object + CreatedAt *string `json:"created_at,omitempty"` // Date/Time render task was created + DashboardFilters *string `json:"dashboard_filters,omitempty"` // Filter values to apply to the dashboard queries, in URL query format + DashboardId *int64 `json:"dashboard_id,omitempty"` // Id of dashboard to render + DashboardStyle *string `json:"dashboard_style,omitempty"` // Dashboard layout style: single_column or tiled + FinalizedAt *string `json:"finalized_at,omitempty"` // Date/Time render task was completed + Height *int64 `json:"height,omitempty"` // Output height in pixels. Flowed layouts may ignore this value. + Id *string `json:"id,omitempty"` // Id of this render task + LookId *int64 `json:"look_id,omitempty"` // Id of look to render + LookmlDashboardId *string `json:"lookml_dashboard_id,omitempty"` // Id of lookml dashboard to render + QueryId *int64 `json:"query_id,omitempty"` // Id of query to render + DashboardElementId *string `json:"dashboard_element_id,omitempty"` // Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id + QueryRuntime *float64 `json:"query_runtime,omitempty"` // Number of seconds elapsed running queries + RenderRuntime *float64 `json:"render_runtime,omitempty"` // Number of seconds elapsed rendering data + ResultFormat *string `json:"result_format,omitempty"` // Output format: pdf, png, or jpg + Runtime *float64 `json:"runtime,omitempty"` // Total seconds elapsed for render task + Status *string `json:"status,omitempty"` // Render task status: enqueued_for_query, querying, enqueued_for_render, rendering, success, failure + StatusDetail *string `json:"status_detail,omitempty"` // Additional information about the current status + UserId *int64 `json:"user_id,omitempty"` // The user account permissions in which the render task will execute + Width *int64 `json:"width,omitempty"` // Output width in pixels } @@ -3222,7 +3227,7 @@ type WriteCustomWelcomeEmail struct { } // Dynamic writeable type for Dashboard removes: -// can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count +// can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count type WriteDashboard struct { Description *string `json:"description,omitempty"` // Description Hidden *bool `json:"hidden,omitempty"` // Is Hidden diff --git a/go/sdk/v4/methods.go b/go/sdk/v4/methods.go index 4178426db..dccef862f 100644 --- a/go/sdk/v4/methods.go +++ b/go/sdk/v4/methods.go @@ -92,13 +92,13 @@ func (l *LookerSDK) UpdateAlert( } // ### Update select alert fields -// # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` +// # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` // # // // PATCH /alerts/{alert_id} -> Alert func (l *LookerSDK) UpdateAlertField( alertId int64, - body WriteAlert, + body AlertPatch, options *rtl.ApiSettings) (Alert, error) { var result Alert err := l.session.Do(&result, "PATCH", "/4.0", fmt.Sprintf("/alerts/%v", alertId), nil, body, options) diff --git a/go/sdk/v4/models.go b/go/sdk/v4/models.go index e2425e461..4c50db685 100644 --- a/go/sdk/v4/models.go +++ b/go/sdk/v4/models.go @@ -26,7 +26,7 @@ SOFTWARE. /* -351 API models: 220 Spec, 54 Request, 57 Write, 20 Enum +352 API models: 221 Spec, 54 Request, 57 Write, 20 Enum */ @@ -50,34 +50,35 @@ type AccessToken struct { type Alert struct { AppliedDashboardFilters *[]AlertAppliedDashboardFilter `json:"applied_dashboard_filters,omitempty"` // Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` - ComparisonType *ComparisonType `json:"comparison_type,omitempty"` // This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". - Cron *string `json:"cron,omitempty"` // Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + ComparisonType ComparisonType `json:"comparison_type"` // This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". + Cron string `json:"cron"` // Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals CustomTitle *string `json:"custom_title,omitempty"` // An optional, user-defined title for the alert DashboardElementId *int64 `json:"dashboard_element_id,omitempty"` // ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement) Description *string `json:"description,omitempty"` // An optional description for the alert. This supplements the title - Destinations *[]AlertDestination `json:"destinations,omitempty"` // Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` - Field *AlertField `json:"field,omitempty"` + Destinations []AlertDestination `json:"destinations"` // Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` + Field AlertField `json:"field"` Followed *bool `json:"followed,omitempty"` // Whether or not the user follows this alert. Followable *bool `json:"followable,omitempty"` // Whether or not the alert is followable Id *int64 `json:"id,omitempty"` // ID of the alert IsDisabled *bool `json:"is_disabled,omitempty"` // Whether or not the alert is disabled + DisabledReason *string `json:"disabled_reason,omitempty"` // Reason for disabling alert IsPublic *bool `json:"is_public,omitempty"` // Whether or not the alert is public InvestigativeContentType *InvestigativeContentType `json:"investigative_content_type,omitempty"` // The type of the investigative content Valid values are: "dashboard". InvestigativeContentId *string `json:"investigative_content_id,omitempty"` // The ID of the investigative content. For dashboards, this will be the dashboard ID InvestigativeContentTitle *string `json:"investigative_content_title,omitempty"` // The title of the investigative content. LookmlDashboardId *string `json:"lookml_dashboard_id,omitempty"` // ID of the LookML dashboard associated with the alert LookmlLinkId *string `json:"lookml_link_id,omitempty"` // ID of the LookML dashboard element associated with the alert - OwnerId *int64 `json:"owner_id,omitempty"` // User id of alert owner + OwnerId int64 `json:"owner_id"` // User id of alert owner OwnerDisplayName *string `json:"owner_display_name,omitempty"` // Alert owner's display name - Threshold *float64 `json:"threshold,omitempty"` // Value of the alert threshold + Threshold float64 `json:"threshold"` // Value of the alert threshold TimeSeriesConditionState *AlertConditionState `json:"time_series_condition_state,omitempty"` } type AlertAppliedDashboardFilter struct { - FilterTitle *string `json:"filter_title,omitempty"` // Field Title. Refer to `DashboardFilter.title` in [DashboardFilter](#!/types/DashboardFilter). Example `Name` - FieldName *string `json:"field_name,omitempty"` // Field Name. Refer to `DashboardFilter.dimension` in [DashboardFilter](#!/types/DashboardFilter). Example `distribution_centers.name` - FilterValue *string `json:"filter_value,omitempty"` // Field Value. [Filter Expressions](https://docs.looker.com/reference/filter-expressions). Example `Los Angeles CA` + FilterTitle string `json:"filter_title"` // Field Title. Refer to `DashboardFilter.title` in [DashboardFilter](#!/types/DashboardFilter). Example `Name` + FieldName string `json:"field_name"` // Field Name. Refer to `DashboardFilter.dimension` in [DashboardFilter](#!/types/DashboardFilter). Example `distribution_centers.name` + FilterValue string `json:"filter_value"` // Field Value. [Filter Expressions](https://docs.looker.com/reference/filter-expressions). Example `Los Angeles CA` FilterDescription *string `json:"filter_description,omitempty"` // Human Readable Filter Description. This may be null or auto-generated. Example `is Los Angeles CA` } @@ -97,16 +98,25 @@ type AlertDestination struct { type AlertField struct { - Title *string `json:"title,omitempty"` // Field's title. Usually auto-generated to reflect field name and its filters - Name *string `json:"name,omitempty"` // Field's name. Has the format `.` Refer to [docs](https://docs.looker.com/sharing-and-publishing/creating-alerts) for more details + Title string `json:"title"` // Field's title. Usually auto-generated to reflect field name and its filters + Name string `json:"name"` // Field's name. Has the format `.` Refer to [docs](https://docs.looker.com/sharing-and-publishing/creating-alerts) for more details Filter *[]AlertFieldFilter `json:"filter,omitempty"` // (Optional / Advance Use) List of fields filter. This further restricts the alert to certain dashboard element's field values. This can be used on top of dashboard filters `applied_dashboard_filters`. To keep thing simple, it's suggested to just use dashboard filters. Example: `{ 'title': '12 Number on Hand', 'name': 'inventory_items.number_on_hand', 'filter': [{ 'field_name': 'inventory_items.id', 'field_value': 12, 'filter_value': null }] }` } type AlertFieldFilter struct { - FieldName *string `json:"field_name,omitempty"` // Field Name. Has format `.` - FieldValue *interface{} `json:"field_value,omitempty"` // Field Value. Depends on the type of field - numeric or string. For [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type, it's a list of floats. Example `[1.0, 56.0]` - FilterValue *string `json:"filter_value,omitempty"` // Filter Value. Usually null except for [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type. It'll be a string of lat,long ie `'1.0,56.0'` + FieldName string `json:"field_name"` // Field Name. Has format `.` + FieldValue interface{} `json:"field_value"` // Field Value. Depends on the type of field - numeric or string. For [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type, it's a list of floats. Example `[1.0, 56.0]` + FilterValue *string `json:"filter_value,omitempty"` // Filter Value. Usually null except for [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type. It'll be a string of lat,long ie `'1.0,56.0'` +} + + +type AlertPatch struct { + OwnerId *int64 `json:"owner_id,omitempty"` // New owner ID of the alert + IsDisabled *bool `json:"is_disabled,omitempty"` // Set alert enabled or disabled + DisabledReason *string `json:"disabled_reason,omitempty"` // The reason this alert is disabled + IsPublic *bool `json:"is_public,omitempty"` // Set alert public or private + Threshold *float64 `json:"threshold,omitempty"` // New threshold value } type Align string @@ -696,6 +706,10 @@ type Dashboard struct { FiltersBarCollapsed *bool `json:"filters_bar_collapsed,omitempty"` // Sets the default state of the filters bar to collapsed or open LastAccessedAt *time.Time `json:"last_accessed_at,omitempty"` // Time the dashboard was last accessed LastViewedAt *time.Time `json:"last_viewed_at,omitempty"` // Time last viewed in the Looker web UI + UpdatedAt *time.Time `json:"updated_at,omitempty"` // Time that the Dashboard was most recently updated. + LastUpdaterId *int64 `json:"last_updater_id,omitempty"` // Id of User that most recently updated the dashboard. + LastUpdaterName *string `json:"last_updater_name,omitempty"` // Name of User that most recently updated the dashboard. + UserName *string `json:"user_name,omitempty"` // Name of User that created the dashboard. LoadConfiguration *string `json:"load_configuration,omitempty"` // configuration option that governs how dashboard loading will happen. LookmlLinkId *string `json:"lookml_link_id,omitempty"` // Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match. ShowFiltersBar *bool `json:"show_filters_bar,omitempty"` // Show filters bar. **Security Note:** This property only affects the *cosmetic* appearance of the dashboard, not a user's ability to access data. Hiding the filters bar does **NOT** prevent users from changing filters by other means. For information on how to set up secure data access control policies, see [Control User Access to Data](https://looker.com/docs/r/api/control-access) @@ -903,7 +917,7 @@ type DBConnection struct { Snippets *[]Snippet `json:"snippets,omitempty"` // SQL Runner snippets for this connection PdtsEnabled *bool `json:"pdts_enabled,omitempty"` // True if PDTs are enabled on this connection Host *string `json:"host,omitempty"` // Host name/address of server - Port *int64 `json:"port,omitempty"` // Port number on server + Port *string `json:"port,omitempty"` // Port number on server Username *string `json:"username,omitempty"` // Username for server authentication Password *string `json:"password,omitempty"` // (Write-Only) Password for server authentication UsesOauth *bool `json:"uses_oauth,omitempty"` // Whether the connection uses OAuth for authentication. @@ -2269,25 +2283,26 @@ type QueryTask struct { type RenderTask struct { - Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object - CreatedAt *string `json:"created_at,omitempty"` // Date/Time render task was created - DashboardFilters *string `json:"dashboard_filters,omitempty"` // Filter values to apply to the dashboard queries, in URL query format - DashboardId *int64 `json:"dashboard_id,omitempty"` // Id of dashboard to render - DashboardStyle *string `json:"dashboard_style,omitempty"` // Dashboard layout style: single_column or tiled - FinalizedAt *string `json:"finalized_at,omitempty"` // Date/Time render task was completed - Height *int64 `json:"height,omitempty"` // Output height in pixels. Flowed layouts may ignore this value. - Id *string `json:"id,omitempty"` // Id of this render task - LookId *int64 `json:"look_id,omitempty"` // Id of look to render - LookmlDashboardId *string `json:"lookml_dashboard_id,omitempty"` // Id of lookml dashboard to render - QueryId *int64 `json:"query_id,omitempty"` // Id of query to render - QueryRuntime *float64 `json:"query_runtime,omitempty"` // Number of seconds elapsed running queries - RenderRuntime *float64 `json:"render_runtime,omitempty"` // Number of seconds elapsed rendering data - ResultFormat *string `json:"result_format,omitempty"` // Output format: pdf, png, or jpg - Runtime *float64 `json:"runtime,omitempty"` // Total seconds elapsed for render task - Status *string `json:"status,omitempty"` // Render task status: enqueued_for_query, querying, enqueued_for_render, rendering, success, failure - StatusDetail *string `json:"status_detail,omitempty"` // Additional information about the current status - UserId *int64 `json:"user_id,omitempty"` // The user account permissions in which the render task will execute - Width *int64 `json:"width,omitempty"` // Output width in pixels + Can *map[string]bool `json:"can,omitempty"` // Operations the current user is able to perform on this object + CreatedAt *string `json:"created_at,omitempty"` // Date/Time render task was created + DashboardFilters *string `json:"dashboard_filters,omitempty"` // Filter values to apply to the dashboard queries, in URL query format + DashboardId *int64 `json:"dashboard_id,omitempty"` // Id of dashboard to render + DashboardStyle *string `json:"dashboard_style,omitempty"` // Dashboard layout style: single_column or tiled + FinalizedAt *string `json:"finalized_at,omitempty"` // Date/Time render task was completed + Height *int64 `json:"height,omitempty"` // Output height in pixels. Flowed layouts may ignore this value. + Id *string `json:"id,omitempty"` // Id of this render task + LookId *int64 `json:"look_id,omitempty"` // Id of look to render + LookmlDashboardId *string `json:"lookml_dashboard_id,omitempty"` // Id of lookml dashboard to render + QueryId *int64 `json:"query_id,omitempty"` // Id of query to render + DashboardElementId *string `json:"dashboard_element_id,omitempty"` // Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id + QueryRuntime *float64 `json:"query_runtime,omitempty"` // Number of seconds elapsed running queries + RenderRuntime *float64 `json:"render_runtime,omitempty"` // Number of seconds elapsed rendering data + ResultFormat *string `json:"result_format,omitempty"` // Output format: pdf, png, or jpg + Runtime *float64 `json:"runtime,omitempty"` // Total seconds elapsed for render task + Status *string `json:"status,omitempty"` // Render task status: enqueued_for_query, querying, enqueued_for_render, rendering, success, failure + StatusDetail *string `json:"status_detail,omitempty"` // Additional information about the current status + UserId *int64 `json:"user_id,omitempty"` // The user account permissions in which the render task will execute + Width *int64 `json:"width,omitempty"` // Output width in pixels } @@ -3545,21 +3560,22 @@ type Workspace struct { // followed, followable, id, investigative_content_title, owner_display_name type WriteAlert struct { AppliedDashboardFilters *[]AlertAppliedDashboardFilter `json:"applied_dashboard_filters,omitempty"` // Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` - ComparisonType *ComparisonType `json:"comparison_type,omitempty"` // This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". - Cron *string `json:"cron,omitempty"` // Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + ComparisonType ComparisonType `json:"comparison_type"` // This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". + Cron string `json:"cron"` // Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals CustomTitle *string `json:"custom_title,omitempty"` // An optional, user-defined title for the alert DashboardElementId *int64 `json:"dashboard_element_id,omitempty"` // ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement) Description *string `json:"description,omitempty"` // An optional description for the alert. This supplements the title - Destinations *[]AlertDestination `json:"destinations,omitempty"` // Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` - Field *AlertField `json:"field,omitempty"` + Destinations []AlertDestination `json:"destinations"` // Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` + Field AlertField `json:"field"` IsDisabled *bool `json:"is_disabled,omitempty"` // Whether or not the alert is disabled + DisabledReason *string `json:"disabled_reason,omitempty"` // Reason for disabling alert IsPublic *bool `json:"is_public,omitempty"` // Whether or not the alert is public InvestigativeContentType *InvestigativeContentType `json:"investigative_content_type,omitempty"` // The type of the investigative content Valid values are: "dashboard". InvestigativeContentId *string `json:"investigative_content_id,omitempty"` // The ID of the investigative content. For dashboards, this will be the dashboard ID LookmlDashboardId *string `json:"lookml_dashboard_id,omitempty"` // ID of the LookML dashboard associated with the alert LookmlLinkId *string `json:"lookml_link_id,omitempty"` // ID of the LookML dashboard element associated with the alert - OwnerId *int64 `json:"owner_id,omitempty"` // User id of alert owner - Threshold *float64 `json:"threshold,omitempty"` // Value of the alert threshold + OwnerId int64 `json:"owner_id"` // User id of alert owner + Threshold float64 `json:"threshold"` // Value of the alert threshold TimeSeriesConditionState *AlertConditionState `json:"time_series_condition_state,omitempty"` } @@ -3683,7 +3699,7 @@ type WriteCredentialsEmail struct { } // Dynamic writeable type for Dashboard removes: -// can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count, url +// can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count, url type WriteDashboard struct { Description *string `json:"description,omitempty"` // Description Hidden *bool `json:"hidden,omitempty"` // Is Hidden @@ -3794,7 +3810,7 @@ type WriteDatagroup struct { type WriteDBConnection struct { Name *string `json:"name,omitempty"` // Name of the connection. Also used as the unique identifier Host *string `json:"host,omitempty"` // Host name/address of server - Port *int64 `json:"port,omitempty"` // Port number on server + Port *string `json:"port,omitempty"` // Port number on server Username *string `json:"username,omitempty"` // Username for server authentication Password *string `json:"password,omitempty"` // (Write-Only) Password for server authentication Certificate *string `json:"certificate,omitempty"` // (Write-Only) Base64 encoded Certificate body for server authentication (when appropriate for dialect). diff --git a/kotlin/src/main/com/looker/sdk/4.0/methods.kt b/kotlin/src/main/com/looker/sdk/4.0/methods.kt index 543a91476..d97db47ba 100644 --- a/kotlin/src/main/com/looker/sdk/4.0/methods.kt +++ b/kotlin/src/main/com/looker/sdk/4.0/methods.kt @@ -120,17 +120,17 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) { /** * ### Update select alert fields - * # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + * # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` * # * * @param {Long} alert_id ID of an alert - * @param {WriteAlert} body + * @param {AlertPatch} body * * PATCH /alerts/{alert_id} -> Alert */ fun update_alert_field( alert_id: Long, - body: WriteAlert + body: AlertPatch ) : SDKResponse { val path_alert_id = encodeParam(alert_id) return this.patch("/alerts/${path_alert_id}", mapOf(), body) diff --git a/kotlin/src/main/com/looker/sdk/4.0/models.kt b/kotlin/src/main/com/looker/sdk/4.0/models.kt index e5a3e282b..54c0630e7 100644 --- a/kotlin/src/main/com/looker/sdk/4.0/models.kt +++ b/kotlin/src/main/com/looker/sdk/4.0/models.kt @@ -25,7 +25,7 @@ */ /** - * 297 API models: 220 Spec, 0 Request, 57 Write, 20 Enum + * 298 API models: 221 Spec, 0 Request, 57 Write, 20 Enum */ @@ -63,6 +63,7 @@ data class AccessToken ( * @property followable Whether or not the alert is followable (read-only) * @property id ID of the alert (read-only) * @property is_disabled Whether or not the alert is disabled + * @property disabled_reason Reason for disabling alert * @property is_public Whether or not the alert is public * @property investigative_content_type The type of the investigative content Valid values are: "dashboard". * @property investigative_content_id The ID of the investigative content. For dashboards, this will be the dashboard ID @@ -76,26 +77,27 @@ data class AccessToken ( */ data class Alert ( var applied_dashboard_filters: Array? = null, - var comparison_type: ComparisonType? = null, - var cron: String? = null, + var comparison_type: ComparisonType, + var cron: String, var custom_title: String? = null, var dashboard_element_id: Long? = null, var description: String? = null, - var destinations: Array? = null, - var field: AlertField? = null, + var destinations: Array, + var field: AlertField, var followed: Boolean? = null, var followable: Boolean? = null, var id: Long? = null, var is_disabled: Boolean? = null, + var disabled_reason: String? = null, var is_public: Boolean? = null, var investigative_content_type: InvestigativeContentType? = null, var investigative_content_id: String? = null, var investigative_content_title: String? = null, var lookml_dashboard_id: String? = null, var lookml_link_id: String? = null, - var owner_id: Long? = null, + var owner_id: Long, var owner_display_name: String? = null, - var threshold: Double? = null, + var threshold: Double, var time_series_condition_state: AlertConditionState? = null ) : Serializable @@ -106,9 +108,9 @@ data class Alert ( * @property filter_description Human Readable Filter Description. This may be null or auto-generated. Example `is Los Angeles CA` (read-only) */ data class AlertAppliedDashboardFilter ( - var filter_title: String? = null, - var field_name: String? = null, - var filter_value: String? = null, + var filter_title: String, + var field_name: String, + var filter_value: String, var filter_description: String? = null ) : Serializable @@ -140,8 +142,8 @@ data class AlertDestination ( * @property filter (Optional / Advance Use) List of fields filter. This further restricts the alert to certain dashboard element's field values. This can be used on top of dashboard filters `applied_dashboard_filters`. To keep thing simple, it's suggested to just use dashboard filters. Example: `{ 'title': '12 Number on Hand', 'name': 'inventory_items.number_on_hand', 'filter': [{ 'field_name': 'inventory_items.id', 'field_value': 12, 'filter_value': null }] }` */ data class AlertField ( - var title: String? = null, - var name: String? = null, + var title: String, + var name: String, var filter: Array? = null ) : Serializable @@ -151,11 +153,26 @@ data class AlertField ( * @property filter_value Filter Value. Usually null except for [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type. It'll be a string of lat,long ie `'1.0,56.0'` */ data class AlertFieldFilter ( - var field_name: String? = null, - var field_value: Any? = null, + var field_name: String, + var field_value: Any, var filter_value: String? = null ) : Serializable +/** + * @property owner_id New owner ID of the alert + * @property is_disabled Set alert enabled or disabled + * @property disabled_reason The reason this alert is disabled + * @property is_public Set alert public or private + * @property threshold New threshold value + */ +data class AlertPatch ( + var owner_id: Long? = null, + var is_disabled: Boolean? = null, + var disabled_reason: String? = null, + var is_public: Boolean? = null, + var threshold: Double? = null +) : Serializable + /** * The appropriate horizontal text alignment the values of this field should be displayed in. Valid values are: "left", "right". */ @@ -1143,6 +1160,10 @@ data class CustomWelcomeEmail ( * @property filters_bar_collapsed Sets the default state of the filters bar to collapsed or open * @property last_accessed_at Time the dashboard was last accessed (read-only) * @property last_viewed_at Time last viewed in the Looker web UI (read-only) + * @property updated_at Time that the Dashboard was most recently updated. (read-only) + * @property last_updater_id Id of User that most recently updated the dashboard. (read-only) + * @property last_updater_name Name of User that most recently updated the dashboard. (read-only) + * @property user_name Name of User that created the dashboard. (read-only) * @property load_configuration configuration option that governs how dashboard loading will happen. * @property lookml_link_id Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match. * @property show_filters_bar Show filters bar. **Security Note:** This property only affects the *cosmetic* appearance of the dashboard, not a user's ability to access data. Hiding the filters bar does **NOT** prevent users from changing filters by other means. For information on how to set up secure data access control policies, see [Control User Access to Data](https://looker.com/docs/r/api/control-access) @@ -1188,6 +1209,10 @@ data class Dashboard ( var filters_bar_collapsed: Boolean? = null, var last_accessed_at: Date? = null, var last_viewed_at: Date? = null, + var updated_at: Date? = null, + var last_updater_id: Long? = null, + var last_updater_name: String? = null, + var user_name: String? = null, var load_configuration: String? = null, var lookml_link_id: String? = null, var show_filters_bar: Boolean? = null, @@ -1578,7 +1603,7 @@ data class DBConnection ( var snippets: Array? = null, var pdts_enabled: Boolean? = null, var host: String? = null, - var port: Long? = null, + var port: String? = null, var username: String? = null, var password: String? = null, var uses_oauth: Boolean? = null, @@ -3955,6 +3980,7 @@ data class QueryTask ( * @property look_id Id of look to render (read-only) * @property lookml_dashboard_id Id of lookml dashboard to render (read-only) * @property query_id Id of query to render (read-only) + * @property dashboard_element_id Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id (read-only) * @property query_runtime Number of seconds elapsed running queries (read-only) * @property render_runtime Number of seconds elapsed rendering data (read-only) * @property result_format Output format: pdf, png, or jpg (read-only) @@ -3976,6 +4002,7 @@ data class RenderTask ( var look_id: Long? = null, var lookml_dashboard_id: String? = null, var query_id: Long? = null, + var dashboard_element_id: String? = null, var query_runtime: Double? = null, var render_runtime: Double? = null, var result_format: String? = null, @@ -5129,6 +5156,7 @@ data class Workspace ( * @property destinations Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` * @property field * @property is_disabled Whether or not the alert is disabled + * @property disabled_reason Reason for disabling alert * @property is_public Whether or not the alert is public * @property investigative_content_type The type of the investigative content Valid values are: "dashboard". * @property investigative_content_id The ID of the investigative content. For dashboards, this will be the dashboard ID @@ -5140,21 +5168,22 @@ data class Workspace ( */ data class WriteAlert ( var applied_dashboard_filters: Array? = null, - var comparison_type: ComparisonType? = null, - var cron: String? = null, + var comparison_type: ComparisonType, + var cron: String, var custom_title: String? = null, var dashboard_element_id: Long? = null, var description: String? = null, - var destinations: Array? = null, - var field: AlertField? = null, + var destinations: Array, + var field: AlertField, var is_disabled: Boolean? = null, + var disabled_reason: String? = null, var is_public: Boolean? = null, var investigative_content_type: InvestigativeContentType? = null, var investigative_content_id: String? = null, var lookml_dashboard_id: String? = null, var lookml_link_id: String? = null, - var owner_id: Long? = null, - var threshold: Double? = null, + var owner_id: Long, + var threshold: Double, var time_series_condition_state: AlertConditionState? = null ) : Serializable @@ -5372,7 +5401,7 @@ data class WriteCredentialsEmail ( /** * Dynamic writeable type for Dashboard removes: - * can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count, url + * can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count, url * * @property description Description * @property hidden Is Hidden @@ -5605,7 +5634,7 @@ data class WriteDatagroup ( data class WriteDBConnection ( var name: String? = null, var host: String? = null, - var port: Long? = null, + var port: String? = null, var username: String? = null, var password: String? = null, var certificate: String? = null, diff --git a/kotlin/src/main/com/looker/sdk/4.0/streams.kt b/kotlin/src/main/com/looker/sdk/4.0/streams.kt index 03a467d7b..8afb7d730 100644 --- a/kotlin/src/main/com/looker/sdk/4.0/streams.kt +++ b/kotlin/src/main/com/looker/sdk/4.0/streams.kt @@ -119,17 +119,17 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) { /** * ### Update select alert fields - * # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + * # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` * # * * @param {Long} alert_id ID of an alert - * @param {WriteAlert} body + * @param {AlertPatch} body * * PATCH /alerts/{alert_id} -> ByteArray */ fun update_alert_field( alert_id: Long, - body: WriteAlert + body: AlertPatch ) : SDKResponse { val path_alert_id = encodeParam(alert_id) return this.patch("/alerts/${path_alert_id}", mapOf(), body) diff --git a/kotlin/src/main/com/looker/sdk/Constants.kt b/kotlin/src/main/com/looker/sdk/Constants.kt index a863d5d8a..838dbb452 100644 --- a/kotlin/src/main/com/looker/sdk/Constants.kt +++ b/kotlin/src/main/com/looker/sdk/Constants.kt @@ -28,7 +28,7 @@ package com.looker.sdk const val ENVIRONMENT_PREFIX = "LOOKERSDK" const val SDK_TAG = "KT-SDK" -const val LOOKER_VERSION = "21.16" +const val LOOKER_VERSION = "21.18" const val API_VERSION = "4.0" const val AGENT_TAG = "$SDK_TAG $LOOKER_VERSION" const val LOOKER_APPID = "x-looker-appid" diff --git a/packages/sdk/src/3.1/funcs.ts b/packages/sdk/src/3.1/funcs.ts index 59db74d7e..bc90c132d 100644 --- a/packages/sdk/src/3.1/funcs.ts +++ b/packages/sdk/src/3.1/funcs.ts @@ -10751,4 +10751,4 @@ export const workspace = async ( ) } -//#endregion Workspace: Manage Workspaces +//#endregion Workspace: Manage Workspaces \ No newline at end of file diff --git a/packages/sdk/src/3.1/methods.ts b/packages/sdk/src/3.1/methods.ts index 4f04c9820..8ad4664bf 100644 --- a/packages/sdk/src/3.1/methods.ts +++ b/packages/sdk/src/3.1/methods.ts @@ -10093,4 +10093,4 @@ export class Looker31SDK extends APIMethods implements ILooker31SDK { } //#endregion Workspace: Manage Workspaces -} +} \ No newline at end of file diff --git a/packages/sdk/src/3.1/methodsInterface.ts b/packages/sdk/src/3.1/methodsInterface.ts index 411acb2df..ebdd86458 100644 --- a/packages/sdk/src/3.1/methodsInterface.ts +++ b/packages/sdk/src/3.1/methodsInterface.ts @@ -7264,4 +7264,4 @@ export interface ILooker31SDK extends IAPIMethods { ): Promise> //#endregion Workspace: Manage Workspaces -} +} \ No newline at end of file diff --git a/packages/sdk/src/3.1/models.ts b/packages/sdk/src/3.1/models.ts index d66c5f7fb..c269799b1 100644 --- a/packages/sdk/src/3.1/models.ts +++ b/packages/sdk/src/3.1/models.ts @@ -1257,6 +1257,22 @@ export interface IDashboard { * Time last viewed in the Looker web UI (read-only) */ last_viewed_at?: Date + /** + * Time that the Dashboard was most recently updated. (read-only) + */ + updated_at?: Date + /** + * Id of User that most recently updated the dashboard. (read-only) + */ + last_updater_id?: number + /** + * Name of User that most recently updated the dashboard. (read-only) + */ + last_updater_name?: string + /** + * Name of User that created the dashboard. (read-only) + */ + user_name?: string /** * configuration option that governs how dashboard loading will happen. */ @@ -5642,6 +5658,10 @@ export interface IRenderTask { * Id of query to render (read-only) */ query_id?: number + /** + * Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id (read-only) + */ + dashboard_element_id?: string /** * Number of seconds elapsed running queries (read-only) */ @@ -9195,7 +9215,7 @@ export interface IWriteCustomWelcomeEmail { /** * Dynamic writeable type for Dashboard removes: - * can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count + * can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count */ export interface IWriteDashboard { /** @@ -10972,4 +10992,4 @@ export interface IWriteWhitelabelConfiguration { * Remove Looker mentions in home folder page when you don’t have any items saved */ folders_mentions?: boolean -} +} \ No newline at end of file diff --git a/packages/sdk/src/3.1/streams.ts b/packages/sdk/src/3.1/streams.ts index a33927e63..7e10d4864 100644 --- a/packages/sdk/src/3.1/streams.ts +++ b/packages/sdk/src/3.1/streams.ts @@ -11594,4 +11594,4 @@ export class Looker31SDKStream extends APIMethods { } //#endregion Workspace: Manage Workspaces -} +} \ No newline at end of file diff --git a/packages/sdk/src/4.0/funcs.ts b/packages/sdk/src/4.0/funcs.ts index 83ef1bd31..54b673dda 100644 --- a/packages/sdk/src/4.0/funcs.ts +++ b/packages/sdk/src/4.0/funcs.ts @@ -47,6 +47,7 @@ import { sdkVersion } from '../constants' import type { IAccessToken, IAlert, + IAlertPatch, IApiSession, IApiVersion, IBackupConfiguration, @@ -377,21 +378,21 @@ export const update_alert = async ( /** * ### Update select alert fields - * # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + * # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` * # * * PATCH /alerts/{alert_id} -> IAlert * * @param sdk IAPIMethods implementation * @param alert_id ID of an alert - * @param body Partial + * @param body Partial * @param options one-time API call overrides * */ export const update_alert_field = async ( sdk: IAPIMethods, alert_id: number, - body: Partial, + body: Partial, options?: Partial ): Promise> => { return sdk.patch( @@ -12151,4 +12152,4 @@ export const workspace = async ( ) } -//#endregion Workspace: Manage Workspaces +//#endregion Workspace: Manage Workspaces \ No newline at end of file diff --git a/packages/sdk/src/4.0/methods.ts b/packages/sdk/src/4.0/methods.ts index 44b355347..9eaa12d62 100644 --- a/packages/sdk/src/4.0/methods.ts +++ b/packages/sdk/src/4.0/methods.ts @@ -45,6 +45,7 @@ import type { ILooker40SDK } from './methodsInterface' import type { IAccessToken, IAlert, + IAlertPatch, IApiSession, IApiVersion, IBackupConfiguration, @@ -372,19 +373,19 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { /** * ### Update select alert fields - * # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + * # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` * # * * PATCH /alerts/{alert_id} -> IAlert * * @param alert_id ID of an alert - * @param body Partial + * @param body Partial * @param options one-time API call overrides * */ async update_alert_field( alert_id: number, - body: Partial, + body: Partial, options?: Partial ): Promise> { return this.patch( @@ -11411,4 +11412,4 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK { } //#endregion Workspace: Manage Workspaces -} +} \ No newline at end of file diff --git a/packages/sdk/src/4.0/methodsInterface.ts b/packages/sdk/src/4.0/methodsInterface.ts index 72f12d393..bb50038a4 100644 --- a/packages/sdk/src/4.0/methodsInterface.ts +++ b/packages/sdk/src/4.0/methodsInterface.ts @@ -42,6 +42,7 @@ import type { import type { IAccessToken, IAlert, + IAlertPatch, IApiSession, IApiVersion, IBackupConfiguration, @@ -332,19 +333,19 @@ export interface ILooker40SDK extends IAPIMethods { /** * ### Update select alert fields - * # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + * # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` * # * * PATCH /alerts/{alert_id} -> IAlert * * @param alert_id ID of an alert - * @param body Partial + * @param body Partial * @param options one-time API call overrides * */ update_alert_field( alert_id: number, - body: Partial, + body: Partial, options?: Partial ): Promise> @@ -8194,4 +8195,4 @@ export interface ILooker40SDK extends IAPIMethods { ): Promise> //#endregion Workspace: Manage Workspaces -} +} \ No newline at end of file diff --git a/packages/sdk/src/4.0/models.ts b/packages/sdk/src/4.0/models.ts index 9f05881e1..411a1a154 100644 --- a/packages/sdk/src/4.0/models.ts +++ b/packages/sdk/src/4.0/models.ts @@ -25,7 +25,7 @@ */ /** - * 351 API models: 220 Spec, 54 Request, 57 Write, 20 Enum + * 352 API models: 221 Spec, 54 Request, 57 Write, 20 Enum */ import type { IDictionary, DelimArray } from '@looker/sdk-rtl' @@ -61,11 +61,11 @@ export interface IAlert { /** * This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". */ - comparison_type?: ComparisonType + comparison_type: ComparisonType /** * Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals */ - cron?: string + cron: string /** * An optional, user-defined title for the alert */ @@ -81,8 +81,8 @@ export interface IAlert { /** * Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` */ - destinations?: IAlertDestination[] - field?: IAlertField + destinations: IAlertDestination[] + field: IAlertField /** * Whether or not the user follows this alert. (read-only) */ @@ -99,6 +99,10 @@ export interface IAlert { * Whether or not the alert is disabled */ is_disabled?: boolean + /** + * Reason for disabling alert + */ + disabled_reason?: string /** * Whether or not the alert is public */ @@ -126,7 +130,7 @@ export interface IAlert { /** * User id of alert owner */ - owner_id?: number + owner_id: number /** * Alert owner's display name (read-only) */ @@ -134,7 +138,7 @@ export interface IAlert { /** * Value of the alert threshold */ - threshold?: number + threshold: number time_series_condition_state?: IAlertConditionState } @@ -142,15 +146,15 @@ export interface IAlertAppliedDashboardFilter { /** * Field Title. Refer to `DashboardFilter.title` in [DashboardFilter](#!/types/DashboardFilter). Example `Name` */ - filter_title?: string + filter_title: string /** * Field Name. Refer to `DashboardFilter.dimension` in [DashboardFilter](#!/types/DashboardFilter). Example `distribution_centers.name` */ - field_name?: string + field_name: string /** * Field Value. [Filter Expressions](https://docs.looker.com/reference/filter-expressions). Example `Los Angeles CA` */ - filter_value?: string + filter_value: string /** * Human Readable Filter Description. This may be null or auto-generated. Example `is Los Angeles CA` (read-only) */ @@ -191,11 +195,11 @@ export interface IAlertField { /** * Field's title. Usually auto-generated to reflect field name and its filters */ - title?: string + title: string /** * Field's name. Has the format `.` Refer to [docs](https://docs.looker.com/sharing-and-publishing/creating-alerts) for more details */ - name?: string + name: string /** * (Optional / Advance Use) List of fields filter. This further restricts the alert to certain dashboard element's field values. This can be used on top of dashboard filters `applied_dashboard_filters`. To keep thing simple, it's suggested to just use dashboard filters. Example: `{ 'title': '12 Number on Hand', 'name': 'inventory_items.number_on_hand', 'filter': [{ 'field_name': 'inventory_items.id', 'field_value': 12, 'filter_value': null }] }` */ @@ -206,17 +210,40 @@ export interface IAlertFieldFilter { /** * Field Name. Has format `.` */ - field_name?: string + field_name: string /** * Field Value. Depends on the type of field - numeric or string. For [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type, it's a list of floats. Example `[1.0, 56.0]` */ - field_value?: any + field_value: any /** * Filter Value. Usually null except for [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type. It'll be a string of lat,long ie `'1.0,56.0'` */ filter_value?: string } +export interface IAlertPatch { + /** + * New owner ID of the alert + */ + owner_id?: number + /** + * Set alert enabled or disabled + */ + is_disabled?: boolean + /** + * The reason this alert is disabled + */ + disabled_reason?: string + /** + * Set alert public or private + */ + is_public?: boolean + /** + * New threshold value + */ + threshold?: number +} + /** * The appropriate horizontal text alignment the values of this field should be displayed in. Valid values are: "left", "right". */ @@ -1807,6 +1834,22 @@ export interface IDashboard { * Time last viewed in the Looker web UI (read-only) */ last_viewed_at?: Date + /** + * Time that the Dashboard was most recently updated. (read-only) + */ + updated_at?: Date + /** + * Id of User that most recently updated the dashboard. (read-only) + */ + last_updater_id?: number + /** + * Name of User that most recently updated the dashboard. (read-only) + */ + last_updater_name?: string + /** + * Name of User that created the dashboard. (read-only) + */ + user_name?: string /** * configuration option that governs how dashboard loading will happen. */ @@ -2403,7 +2446,7 @@ export interface IDBConnection { /** * Port number on server */ - port?: number + port?: string /** * Username for server authentication */ @@ -6400,6 +6443,10 @@ export interface IRenderTask { * Id of query to render (read-only) */ query_id?: number + /** + * Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id (read-only) + */ + dashboard_element_id?: string /** * Number of seconds elapsed running queries (read-only) */ @@ -10057,11 +10104,11 @@ export interface IWriteAlert { /** * This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". */ - comparison_type?: ComparisonType + comparison_type: ComparisonType /** * Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals */ - cron?: string + cron: string /** * An optional, user-defined title for the alert */ @@ -10077,12 +10124,16 @@ export interface IWriteAlert { /** * Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` */ - destinations?: IAlertDestination[] - field?: IAlertField + destinations: IAlertDestination[] + field: IAlertField /** * Whether or not the alert is disabled */ is_disabled?: boolean + /** + * Reason for disabling alert + */ + disabled_reason?: string /** * Whether or not the alert is public */ @@ -10106,11 +10157,11 @@ export interface IWriteAlert { /** * User id of alert owner */ - owner_id?: number + owner_id: number /** * Value of the alert threshold */ - threshold?: number + threshold: number time_series_condition_state?: IAlertConditionState } @@ -10430,7 +10481,7 @@ export interface IWriteCredentialsEmail { /** * Dynamic writeable type for Dashboard removes: - * can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count, url + * can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count, url */ export interface IWriteDashboard { /** @@ -10763,7 +10814,7 @@ export interface IWriteDBConnection { /** * Port number on server */ - port?: number + port?: string /** * Username for server authentication */ @@ -12203,4 +12254,4 @@ export interface IWriteWhitelabelConfiguration { * Remove Looker mentions in home folder page when you don’t have any items saved */ folders_mentions?: boolean -} +} \ No newline at end of file diff --git a/packages/sdk/src/4.0/streams.ts b/packages/sdk/src/4.0/streams.ts index 980b7d25f..8c69e8485 100644 --- a/packages/sdk/src/4.0/streams.ts +++ b/packages/sdk/src/4.0/streams.ts @@ -45,6 +45,7 @@ import { sdkVersion } from '../constants' import type { IAccessToken, IAlert, + IAlertPatch, IApiSession, IApiVersion, IBackupConfiguration, @@ -388,21 +389,21 @@ export class Looker40SDKStream extends APIMethods { /** * ### Update select alert fields - * # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + * # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` * # * * PATCH /alerts/{alert_id} -> IAlert * * @param callback streaming output function * @param alert_id ID of an alert - * @param body Partial + * @param body Partial * @param options one-time API call overrides * */ async update_alert_field( callback: (readable: Readable) => Promise, alert_id: number, - body: Partial, + body: Partial, options?: Partial ) { return this.authStream( @@ -13103,4 +13104,4 @@ export class Looker40SDKStream extends APIMethods { } //#endregion Workspace: Manage Workspaces -} +} \ No newline at end of file diff --git a/packages/sdk/src/constants.ts b/packages/sdk/src/constants.ts index d95816cdd..866459776 100644 --- a/packages/sdk/src/constants.ts +++ b/packages/sdk/src/constants.ts @@ -24,5 +24,5 @@ */ -export const sdkVersion = '21.16' +export const sdkVersion = '21.18' export const environmentPrefix = 'LOOKERSDK' diff --git a/python/looker_sdk/sdk/api31/models.py b/python/looker_sdk/sdk/api31/models.py index 1d8524169..974c00785 100644 --- a/python/looker_sdk/sdk/api31/models.py +++ b/python/looker_sdk/sdk/api31/models.py @@ -1624,6 +1624,10 @@ class Dashboard(model.Model): filters_bar_collapsed: Sets the default state of the filters bar to collapsed or open last_accessed_at: Time the dashboard was last accessed last_viewed_at: Time last viewed in the Looker web UI + updated_at: Time that the Dashboard was most recently updated. + last_updater_id: Id of User that most recently updated the dashboard. + last_updater_name: Name of User that most recently updated the dashboard. + user_name: Name of User that created the dashboard. load_configuration: configuration option that governs how dashboard loading will happen. lookml_link_id: Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match. show_filters_bar: Show filters bar. **Security Note:** This property only affects the *cosmetic* appearance of the dashboard, not a user's ability to access data. Hiding the filters bar does **NOT** prevent users from changing filters by other means. For information on how to set up secure data access control policies, see [Control User Access to Data](https://looker.com/docs/r/api/control-access) @@ -1670,6 +1674,10 @@ class Dashboard(model.Model): filters_bar_collapsed: Optional[bool] = None last_accessed_at: Optional[datetime.datetime] = None last_viewed_at: Optional[datetime.datetime] = None + updated_at: Optional[datetime.datetime] = None + last_updater_id: Optional[int] = None + last_updater_name: Optional[str] = None + user_name: Optional[str] = None load_configuration: Optional[str] = None lookml_link_id: Optional[str] = None show_filters_bar: Optional[bool] = None @@ -1718,6 +1726,10 @@ def __init__( filters_bar_collapsed: Optional[bool] = None, last_accessed_at: Optional[datetime.datetime] = None, last_viewed_at: Optional[datetime.datetime] = None, + updated_at: Optional[datetime.datetime] = None, + last_updater_id: Optional[int] = None, + last_updater_name: Optional[str] = None, + user_name: Optional[str] = None, load_configuration: Optional[str] = None, lookml_link_id: Optional[str] = None, show_filters_bar: Optional[bool] = None, @@ -1765,6 +1777,10 @@ def __init__( self.filters_bar_collapsed = filters_bar_collapsed self.last_accessed_at = last_accessed_at self.last_viewed_at = last_viewed_at + self.updated_at = updated_at + self.last_updater_id = last_updater_id + self.last_updater_name = last_updater_name + self.user_name = user_name self.load_configuration = load_configuration self.lookml_link_id = lookml_link_id self.show_filters_bar = show_filters_bar @@ -7243,6 +7259,7 @@ class RenderTask(model.Model): look_id: Id of look to render lookml_dashboard_id: Id of lookml dashboard to render query_id: Id of query to render + dashboard_element_id: Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id query_runtime: Number of seconds elapsed running queries render_runtime: Number of seconds elapsed rendering data result_format: Output format: pdf, png, or jpg @@ -7264,6 +7281,7 @@ class RenderTask(model.Model): look_id: Optional[int] = None lookml_dashboard_id: Optional[str] = None query_id: Optional[int] = None + dashboard_element_id: Optional[str] = None query_runtime: Optional[float] = None render_runtime: Optional[float] = None result_format: Optional[str] = None @@ -7287,6 +7305,7 @@ def __init__( look_id: Optional[int] = None, lookml_dashboard_id: Optional[str] = None, query_id: Optional[int] = None, + dashboard_element_id: Optional[str] = None, query_runtime: Optional[float] = None, render_runtime: Optional[float] = None, result_format: Optional[str] = None, @@ -7307,6 +7326,7 @@ def __init__( self.look_id = look_id self.lookml_dashboard_id = lookml_dashboard_id self.query_id = query_id + self.dashboard_element_id = dashboard_element_id self.query_runtime = query_runtime self.render_runtime = render_runtime self.result_format = result_format @@ -9770,7 +9790,7 @@ def __init__( class WriteDashboard(model.Model): """ Dynamic writeable type for Dashboard removes: - can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count + can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count Attributes: description: Description diff --git a/python/looker_sdk/sdk/api40/methods.py b/python/looker_sdk/sdk/api40/methods.py index 625043b0a..9cff31808 100644 --- a/python/looker_sdk/sdk/api40/methods.py +++ b/python/looker_sdk/sdk/api40/methods.py @@ -133,7 +133,7 @@ def update_alert( return response # ### Update select alert fields - # # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + # # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` # # # # PATCH /alerts/{alert_id} -> models.Alert @@ -141,7 +141,7 @@ def update_alert_field( self, # ID of an alert alert_id: int, - body: models.WriteAlert, + body: models.AlertPatch, transport_options: Optional[transport.TransportOptions] = None, ) -> models.Alert: """Update select fields on an alert""" diff --git a/python/looker_sdk/sdk/api40/models.py b/python/looker_sdk/sdk/api40/models.py index 9cfa6ce90..b814cb5e2 100644 --- a/python/looker_sdk/sdk/api40/models.py +++ b/python/looker_sdk/sdk/api40/models.py @@ -21,7 +21,7 @@ # SOFTWARE. # -# 297 API models: 220 Spec, 0 Request, 57 Write, 20 Enum +# 298 API models: 221 Spec, 0 Request, 57 Write, 20 Enum # NOTE: Do not edit this file generated by Looker SDK Codegen for API 4.0 @@ -76,102 +76,131 @@ def __init__( class Alert(model.Model): """ Attributes: - applied_dashboard_filters: Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` comparison_type: This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". cron: Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + destinations: Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` + field: + owner_id: User id of alert owner + threshold: Value of the alert threshold + applied_dashboard_filters: Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` custom_title: An optional, user-defined title for the alert dashboard_element_id: ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement) description: An optional description for the alert. This supplements the title - destinations: Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` - field: followed: Whether or not the user follows this alert. followable: Whether or not the alert is followable id: ID of the alert is_disabled: Whether or not the alert is disabled + disabled_reason: Reason for disabling alert is_public: Whether or not the alert is public investigative_content_type: The type of the investigative content Valid values are: "dashboard". investigative_content_id: The ID of the investigative content. For dashboards, this will be the dashboard ID investigative_content_title: The title of the investigative content. lookml_dashboard_id: ID of the LookML dashboard associated with the alert lookml_link_id: ID of the LookML dashboard element associated with the alert - owner_id: User id of alert owner owner_display_name: Alert owner's display name - threshold: Value of the alert threshold time_series_condition_state: """ + comparison_type: "ComparisonType" + cron: str + destinations: Sequence["AlertDestination"] + field: "AlertField" + owner_id: int + threshold: float applied_dashboard_filters: Optional[Sequence["AlertAppliedDashboardFilter"]] = None - comparison_type: Optional["ComparisonType"] = None - cron: Optional[str] = None custom_title: Optional[str] = None dashboard_element_id: Optional[int] = None description: Optional[str] = None - destinations: Optional[Sequence["AlertDestination"]] = None - field: Optional["AlertField"] = None followed: Optional[bool] = None followable: Optional[bool] = None id: Optional[int] = None is_disabled: Optional[bool] = None + disabled_reason: Optional[str] = None is_public: Optional[bool] = None investigative_content_type: Optional["InvestigativeContentType"] = None investigative_content_id: Optional[str] = None investigative_content_title: Optional[str] = None lookml_dashboard_id: Optional[str] = None lookml_link_id: Optional[str] = None - owner_id: Optional[int] = None owner_display_name: Optional[str] = None - threshold: Optional[float] = None time_series_condition_state: Optional["AlertConditionState"] = None + __annotations__ = { + "comparison_type": ForwardRef("ComparisonType"), + "cron": str, + "destinations": Sequence["AlertDestination"], + "field": ForwardRef("AlertField"), + "owner_id": int, + "threshold": float, + "applied_dashboard_filters": Optional[Sequence["AlertAppliedDashboardFilter"]], + "custom_title": Optional[str], + "dashboard_element_id": Optional[int], + "description": Optional[str], + "followed": Optional[bool], + "followable": Optional[bool], + "id": Optional[int], + "is_disabled": Optional[bool], + "disabled_reason": Optional[str], + "is_public": Optional[bool], + "investigative_content_type": Optional["InvestigativeContentType"], + "investigative_content_id": Optional[str], + "investigative_content_title": Optional[str], + "lookml_dashboard_id": Optional[str], + "lookml_link_id": Optional[str], + "owner_display_name": Optional[str], + "time_series_condition_state": Optional["AlertConditionState"], + } def __init__( self, *, + comparison_type: "ComparisonType", + cron: str, + destinations: Sequence["AlertDestination"], + field: "AlertField", + owner_id: int, + threshold: float, applied_dashboard_filters: Optional[ Sequence["AlertAppliedDashboardFilter"] ] = None, - comparison_type: Optional["ComparisonType"] = None, - cron: Optional[str] = None, custom_title: Optional[str] = None, dashboard_element_id: Optional[int] = None, description: Optional[str] = None, - destinations: Optional[Sequence["AlertDestination"]] = None, - field: Optional["AlertField"] = None, followed: Optional[bool] = None, followable: Optional[bool] = None, id: Optional[int] = None, is_disabled: Optional[bool] = None, + disabled_reason: Optional[str] = None, is_public: Optional[bool] = None, investigative_content_type: Optional["InvestigativeContentType"] = None, investigative_content_id: Optional[str] = None, investigative_content_title: Optional[str] = None, lookml_dashboard_id: Optional[str] = None, lookml_link_id: Optional[str] = None, - owner_id: Optional[int] = None, owner_display_name: Optional[str] = None, - threshold: Optional[float] = None, time_series_condition_state: Optional["AlertConditionState"] = None ): - self.applied_dashboard_filters = applied_dashboard_filters self.comparison_type = comparison_type self.cron = cron + self.destinations = destinations + self.field = field + self.owner_id = owner_id + self.threshold = threshold + self.applied_dashboard_filters = applied_dashboard_filters self.custom_title = custom_title self.dashboard_element_id = dashboard_element_id self.description = description - self.destinations = destinations - self.field = field self.followed = followed self.followable = followable self.id = id self.is_disabled = is_disabled + self.disabled_reason = disabled_reason self.is_public = is_public self.investigative_content_type = investigative_content_type self.investigative_content_id = investigative_content_id self.investigative_content_title = investigative_content_title self.lookml_dashboard_id = lookml_dashboard_id self.lookml_link_id = lookml_link_id - self.owner_id = owner_id self.owner_display_name = owner_display_name - self.threshold = threshold self.time_series_condition_state = time_series_condition_state @@ -185,17 +214,17 @@ class AlertAppliedDashboardFilter(model.Model): filter_description: Human Readable Filter Description. This may be null or auto-generated. Example `is Los Angeles CA` """ - filter_title: Optional[str] = None - field_name: Optional[str] = None - filter_value: Optional[str] = None + filter_title: str + field_name: str + filter_value: str filter_description: Optional[str] = None def __init__( self, *, - filter_title: Optional[str] = None, - field_name: Optional[str] = None, - filter_value: Optional[str] = None, + filter_title: str, + field_name: str, + filter_value: str, filter_description: Optional[str] = None ): self.filter_title = filter_title @@ -269,15 +298,15 @@ class AlertField(model.Model): filter: (Optional / Advance Use) List of fields filter. This further restricts the alert to certain dashboard element's field values. This can be used on top of dashboard filters `applied_dashboard_filters`. To keep thing simple, it's suggested to just use dashboard filters. Example: `{ 'title': '12 Number on Hand', 'name': 'inventory_items.number_on_hand', 'filter': [{ 'field_name': 'inventory_items.id', 'field_value': 12, 'filter_value': null }] }` """ - title: Optional[str] = None - name: Optional[str] = None + title: str + name: str filter: Optional[Sequence["AlertFieldFilter"]] = None def __init__( self, *, - title: Optional[str] = None, - name: Optional[str] = None, + title: str, + name: str, filter: Optional[Sequence["AlertFieldFilter"]] = None ): self.title = title @@ -294,22 +323,51 @@ class AlertFieldFilter(model.Model): filter_value: Filter Value. Usually null except for [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type. It'll be a string of lat,long ie `'1.0,56.0'` """ - field_name: Optional[str] = None - field_value: Optional[Any] = None + field_name: str + field_value: Any filter_value: Optional[str] = None def __init__( - self, - *, - field_name: Optional[str] = None, - field_value: Optional[Any] = None, - filter_value: Optional[str] = None + self, *, field_name: str, field_value: Any, filter_value: Optional[str] = None ): self.field_name = field_name self.field_value = field_value self.filter_value = filter_value +@attr.s(auto_attribs=True, init=False) +class AlertPatch(model.Model): + """ + Attributes: + owner_id: New owner ID of the alert + is_disabled: Set alert enabled or disabled + disabled_reason: The reason this alert is disabled + is_public: Set alert public or private + threshold: New threshold value + """ + + owner_id: Optional[int] = None + is_disabled: Optional[bool] = None + disabled_reason: Optional[str] = None + is_public: Optional[bool] = None + threshold: Optional[float] = None + + def __init__( + self, + *, + owner_id: Optional[int] = None, + is_disabled: Optional[bool] = None, + disabled_reason: Optional[str] = None, + is_public: Optional[bool] = None, + threshold: Optional[float] = None + ): + self.owner_id = owner_id + self.is_disabled = is_disabled + self.disabled_reason = disabled_reason + self.is_public = is_public + self.threshold = threshold + + class Align(enum.Enum): """ The appropriate horizontal text alignment the values of this field should be displayed in. Valid values are: "left", "right". @@ -2363,6 +2421,10 @@ class Dashboard(model.Model): filters_bar_collapsed: Sets the default state of the filters bar to collapsed or open last_accessed_at: Time the dashboard was last accessed last_viewed_at: Time last viewed in the Looker web UI + updated_at: Time that the Dashboard was most recently updated. + last_updater_id: Id of User that most recently updated the dashboard. + last_updater_name: Name of User that most recently updated the dashboard. + user_name: Name of User that created the dashboard. load_configuration: configuration option that governs how dashboard loading will happen. lookml_link_id: Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match. show_filters_bar: Show filters bar. **Security Note:** This property only affects the *cosmetic* appearance of the dashboard, not a user's ability to access data. Hiding the filters bar does **NOT** prevent users from changing filters by other means. For information on how to set up secure data access control policies, see [Control User Access to Data](https://looker.com/docs/r/api/control-access) @@ -2408,6 +2470,10 @@ class Dashboard(model.Model): filters_bar_collapsed: Optional[bool] = None last_accessed_at: Optional[datetime.datetime] = None last_viewed_at: Optional[datetime.datetime] = None + updated_at: Optional[datetime.datetime] = None + last_updater_id: Optional[int] = None + last_updater_name: Optional[str] = None + user_name: Optional[str] = None load_configuration: Optional[str] = None lookml_link_id: Optional[str] = None show_filters_bar: Optional[bool] = None @@ -2455,6 +2521,10 @@ def __init__( filters_bar_collapsed: Optional[bool] = None, last_accessed_at: Optional[datetime.datetime] = None, last_viewed_at: Optional[datetime.datetime] = None, + updated_at: Optional[datetime.datetime] = None, + last_updater_id: Optional[int] = None, + last_updater_name: Optional[str] = None, + user_name: Optional[str] = None, load_configuration: Optional[str] = None, lookml_link_id: Optional[str] = None, show_filters_bar: Optional[bool] = None, @@ -2501,6 +2571,10 @@ def __init__( self.filters_bar_collapsed = filters_bar_collapsed self.last_accessed_at = last_accessed_at self.last_viewed_at = last_viewed_at + self.updated_at = updated_at + self.last_updater_id = last_updater_id + self.last_updater_name = last_updater_name + self.user_name = user_name self.load_configuration = load_configuration self.lookml_link_id = lookml_link_id self.show_filters_bar = show_filters_bar @@ -3255,7 +3329,7 @@ class DBConnection(model.Model): snippets: Optional[Sequence["Snippet"]] = None pdts_enabled: Optional[bool] = None host: Optional[str] = None - port: Optional[int] = None + port: Optional[str] = None username: Optional[str] = None password: Optional[str] = None uses_oauth: Optional[bool] = None @@ -3301,7 +3375,7 @@ def __init__( snippets: Optional[Sequence["Snippet"]] = None, pdts_enabled: Optional[bool] = None, host: Optional[str] = None, - port: Optional[int] = None, + port: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None, uses_oauth: Optional[bool] = None, @@ -8264,6 +8338,7 @@ class RenderTask(model.Model): look_id: Id of look to render lookml_dashboard_id: Id of lookml dashboard to render query_id: Id of query to render + dashboard_element_id: Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id query_runtime: Number of seconds elapsed running queries render_runtime: Number of seconds elapsed rendering data result_format: Output format: pdf, png, or jpg @@ -8285,6 +8360,7 @@ class RenderTask(model.Model): look_id: Optional[int] = None lookml_dashboard_id: Optional[str] = None query_id: Optional[int] = None + dashboard_element_id: Optional[str] = None query_runtime: Optional[float] = None render_runtime: Optional[float] = None result_format: Optional[str] = None @@ -8308,6 +8384,7 @@ def __init__( look_id: Optional[int] = None, lookml_dashboard_id: Optional[str] = None, query_id: Optional[int] = None, + dashboard_element_id: Optional[str] = None, query_runtime: Optional[float] = None, render_runtime: Optional[float] = None, result_format: Optional[str] = None, @@ -8328,6 +8405,7 @@ def __init__( self.look_id = look_id self.lookml_dashboard_id = lookml_dashboard_id self.query_id = query_id + self.dashboard_element_id = dashboard_element_id self.query_runtime = query_runtime self.render_runtime = render_runtime self.result_format = result_format @@ -10684,82 +10762,106 @@ class WriteAlert(model.Model): followed, followable, id, investigative_content_title, owner_display_name Attributes: - applied_dashboard_filters: Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` comparison_type: This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". cron: Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals + destinations: Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` + field: + owner_id: User id of alert owner + threshold: Value of the alert threshold + applied_dashboard_filters: Filters coming from the dashboard that are applied. Example `[{ "filter_title": "Name", "field_name": "distribution_centers.name", "filter_value": "Los Angeles CA" }]` custom_title: An optional, user-defined title for the alert dashboard_element_id: ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement) description: An optional description for the alert. This supplements the title - destinations: Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` - field: is_disabled: Whether or not the alert is disabled + disabled_reason: Reason for disabling alert is_public: Whether or not the alert is public investigative_content_type: The type of the investigative content Valid values are: "dashboard". investigative_content_id: The ID of the investigative content. For dashboards, this will be the dashboard ID lookml_dashboard_id: ID of the LookML dashboard associated with the alert lookml_link_id: ID of the LookML dashboard element associated with the alert - owner_id: User id of alert owner - threshold: Value of the alert threshold time_series_condition_state: """ + comparison_type: "ComparisonType" + cron: str + destinations: Sequence["AlertDestination"] + field: "AlertField" + owner_id: int + threshold: float applied_dashboard_filters: Optional[Sequence["AlertAppliedDashboardFilter"]] = None - comparison_type: Optional["ComparisonType"] = None - cron: Optional[str] = None custom_title: Optional[str] = None dashboard_element_id: Optional[int] = None description: Optional[str] = None - destinations: Optional[Sequence["AlertDestination"]] = None - field: Optional["AlertField"] = None is_disabled: Optional[bool] = None + disabled_reason: Optional[str] = None is_public: Optional[bool] = None investigative_content_type: Optional["InvestigativeContentType"] = None investigative_content_id: Optional[str] = None lookml_dashboard_id: Optional[str] = None lookml_link_id: Optional[str] = None - owner_id: Optional[int] = None - threshold: Optional[float] = None time_series_condition_state: Optional["AlertConditionState"] = None + __annotations__ = { + "comparison_type": ForwardRef("ComparisonType"), + "cron": str, + "destinations": Sequence["AlertDestination"], + "field": ForwardRef("AlertField"), + "owner_id": int, + "threshold": float, + "applied_dashboard_filters": Optional[Sequence["AlertAppliedDashboardFilter"]], + "custom_title": Optional[str], + "dashboard_element_id": Optional[int], + "description": Optional[str], + "is_disabled": Optional[bool], + "disabled_reason": Optional[str], + "is_public": Optional[bool], + "investigative_content_type": Optional["InvestigativeContentType"], + "investigative_content_id": Optional[str], + "lookml_dashboard_id": Optional[str], + "lookml_link_id": Optional[str], + "time_series_condition_state": Optional["AlertConditionState"], + } def __init__( self, *, + comparison_type: "ComparisonType", + cron: str, + destinations: Sequence["AlertDestination"], + field: "AlertField", + owner_id: int, + threshold: float, applied_dashboard_filters: Optional[ Sequence["AlertAppliedDashboardFilter"] ] = None, - comparison_type: Optional["ComparisonType"] = None, - cron: Optional[str] = None, custom_title: Optional[str] = None, dashboard_element_id: Optional[int] = None, description: Optional[str] = None, - destinations: Optional[Sequence["AlertDestination"]] = None, - field: Optional["AlertField"] = None, is_disabled: Optional[bool] = None, + disabled_reason: Optional[str] = None, is_public: Optional[bool] = None, investigative_content_type: Optional["InvestigativeContentType"] = None, investigative_content_id: Optional[str] = None, lookml_dashboard_id: Optional[str] = None, lookml_link_id: Optional[str] = None, - owner_id: Optional[int] = None, - threshold: Optional[float] = None, time_series_condition_state: Optional["AlertConditionState"] = None ): - self.applied_dashboard_filters = applied_dashboard_filters self.comparison_type = comparison_type self.cron = cron + self.destinations = destinations + self.field = field + self.owner_id = owner_id + self.threshold = threshold + self.applied_dashboard_filters = applied_dashboard_filters self.custom_title = custom_title self.dashboard_element_id = dashboard_element_id self.description = description - self.destinations = destinations - self.field = field self.is_disabled = is_disabled + self.disabled_reason = disabled_reason self.is_public = is_public self.investigative_content_type = investigative_content_type self.investigative_content_id = investigative_content_id self.lookml_dashboard_id = lookml_dashboard_id self.lookml_link_id = lookml_link_id - self.owner_id = owner_id - self.threshold = threshold self.time_series_condition_state = time_series_condition_state @@ -11189,7 +11291,7 @@ def __init__( class WriteDashboard(model.Model): """ Dynamic writeable type for Dashboard removes: - can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count, url + can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count, url Attributes: description: Description @@ -11610,7 +11712,7 @@ class WriteDBConnection(model.Model): name: Optional[str] = None host: Optional[str] = None - port: Optional[int] = None + port: Optional[str] = None username: Optional[str] = None password: Optional[str] = None certificate: Optional[str] = None @@ -11645,7 +11747,7 @@ def __init__( *, name: Optional[str] = None, host: Optional[str] = None, - port: Optional[int] = None, + port: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None, certificate: Optional[str] = None, @@ -13373,6 +13475,10 @@ def __init__( ForwardRef("AlertFieldFilter"), # type: ignore forward_ref_structure_hook, # type:ignore ) +sr.converter40.register_structure_hook( + ForwardRef("AlertPatch"), # type: ignore + forward_ref_structure_hook, # type:ignore +) sr.converter40.register_structure_hook( ForwardRef("Align"), # type: ignore forward_ref_structure_hook, # type:ignore diff --git a/python/looker_sdk/sdk/constants.py b/python/looker_sdk/sdk/constants.py index 04efdaefb..24015929e 100644 --- a/python/looker_sdk/sdk/constants.py +++ b/python/looker_sdk/sdk/constants.py @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -sdk_version = "21.16" +sdk_version = "21.18" environment_prefix = "LOOKERSDK" diff --git a/release-please-config.json b/release-please-config.json index 50148338f..658f10e30 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -2,7 +2,7 @@ "plugins": ["node-workspace"], "bump-minor-pre-major": true, "bump-patch-for-minor-pre-major": true, - "release-as": "", + "release-as": "21.18.0", "packages": { ".": { "release-as": "" }, "packages/api-explorer": { "release-as": "" }, diff --git a/spec/Looker.3.1.json b/spec/Looker.3.1.json index b8aab34cd..1c0ba79cb 100644 --- a/spec/Looker.3.1.json +++ b/spec/Looker.3.1.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "version": "3.1.0", - "x-looker-release-version": "21.16.0", + "x-looker-release-version": "21.18.0", "title": "Looker API 3.1 Reference", "description": "### Authorization\n\nThe classic method of API authorization uses Looker **API3** credentials for authorization and access control.\nLooker admins can create API3 credentials on Looker's **Admin/Users** page.\n\nAPI 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests.\n\nFor details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization).\n\n\n### API Explorer\n\nThe API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs.\nIt is a replacement for the 'api-docs' page currently provided on Looker instances.\n\nFor details, see the [API Explorer documentation](https://looker.com/docs/r/api/explorer).\n\n\n### Looker Language SDKs\n\nThe Looker API is a RESTful system that should be usable by any programming language capable of making\nHTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker\nhas an OpenSource [sdk-codegen project](https://github.com/looker-open-source/sdk-codegen) that provides several\nlanguage SDKs. Language SDKs generated by `sdk-codegen` have an Authentication manager that can automatically\nauthenticate API requests when needed.\n\nFor details on available Looker SDKs, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks).\n\n\n### API Versioning\n\nFuture releases of Looker expand the latest API version release-by-release to securely expose more and more of the core\npower of the Looker platform to API client applications. API endpoints marked as \"beta\" may receive breaking changes without\nwarning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking\nchanges in future releases.\n\nFor details, see [Looker API Versioning](https://looker.com/docs/r/api/versioning).\n\n\n### Try It Out!\n\nThis section describes the existing 'api-docs' page available on Looker instances. We recommend using the\n[API Explorer](https://looker.com/docs/r/api/explorer) instead.\n\nThe 'api-docs' page served by the Looker instance includes 'Try It Out!' buttons for each API method. After logging\nin with API3 credentials, you can use the \"Try It Out!\" buttons to call the API directly from the documentation\npage to interactively explore API features and responses.\n\n**NOTE**! With great power comes great responsibility: The \"Try It Out!\" button makes API calls to your live Looker\ninstance. Be especially careful with destructive API operations such as `delete_user` or similar.\nThere is no \"undo\" for API operations. (API Explorer's \"Run It\" feature requires a check mark before running\nAPI operations that can change data.)\n\n\n### In This Release\n\nThe following are a few examples of noteworthy items that have changed between API 3.0 and API 3.1.\nFor more comprehensive coverage of API changes, please see the release notes for your Looker release.\n\n### Examples of new things added in API 3.1 (compared to API 3.0):\n\n* [Dashboard construction](#!/3.1/Dashboard/) APIs\n* [Themes](#!/3.1/Theme/) and [custom color collections](#!/3.1/ColorCollection) APIs\n* Create and run [SQL Runner](#!/3.1/Query/run_sql_query) queries\n* Create and run [merged results](#!/3.1/Query/create_merge_query) queries\n* Create and modify [dashboard filters](#!/3.1/Dashboard/create_dashboard_filter)\n* Create and modify [password requirements](#!/3.1/Auth/password_config)\n\n### Deprecated in API 3.0\n\nThe following functions and properties have been deprecated in API 3.0. They continue to exist and work in API 3.0\nfor the next several Looker releases but they have not been carried forward to API 3.1:\n\n* Dashboard Prefetch functions\n* User access_filter functions\n* User API 1.0 credentials functions\n* Space.is_root and Space.is_user_root properties. Use Space.is_shared_root and Space.is_users_root instead.\n\n### Semantic changes in API 3.1:\n\n* [all_looks()](#!/3.1/Look/all_looks) no longer includes soft-deleted looks, matching [all_dashboards()](#!/3.1/Dashboard/all_dashboards) behavior.\nYou can find soft-deleted looks using [search_looks()](#!/3.1/Look/search_looks) with the `deleted` param set to True.\n* [all_spaces()](#!/3.1/Space/all_spaces) no longer includes duplicate items\n* [search_users()](#!/3.1/User/search_users) no longer accepts Y,y,1,0,N,n for Boolean params, only \"true\" and \"false\".\n* For greater client and network compatibility, [render_task_results](#!/3.1/RenderTask/render_task_results) now returns\nHTTP status **202 Accepted** instead of HTTP status **102 Processing**\n* [all_running_queries()](#!/3.1/Query/all_running_queries) and [kill_query](#!/3.1/Query/kill_query) functions have moved into the [Query](#!/3.1/Query/) function group.\n\nThe API Explorer can be used to [interactively compare](https://looker.com/docs/r/api/explorer#comparing_api_versions) the differences between API 3.1 and 4.0.\n\n\n### API and SDK Support Policies\n\nLooker API versions and language SDKs have varying support levels. Please read the API and SDK\n[support policies](https://looker.com/docs/r/api/support-policy) for more information.\n\n\n", "contact": { @@ -23592,6 +23592,32 @@ "description": "Time last viewed in the Looker web UI", "x-looker-nullable": true }, + "updated_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "Time that the Dashboard was most recently updated.", + "x-looker-nullable": true + }, + "last_updater_id": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Id of User that most recently updated the dashboard.", + "x-looker-nullable": true + }, + "last_updater_name": { + "type": "string", + "readOnly": true, + "description": "Name of User that most recently updated the dashboard.", + "x-looker-nullable": true + }, + "user_name": { + "type": "string", + "readOnly": true, + "description": "Name of User that created the dashboard.", + "x-looker-nullable": true + }, "load_configuration": { "type": "string", "description": "configuration option that governs how dashboard loading will happen.", @@ -29875,6 +29901,12 @@ "description": "Id of query to render", "x-looker-nullable": true }, + "dashboard_element_id": { + "type": "string", + "readOnly": true, + "description": "Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id", + "x-looker-nullable": true + }, "query_runtime": { "type": "number", "format": "double", diff --git a/spec/Looker.3.1.oas.json b/spec/Looker.3.1.oas.json index a2405dbdf..50bef79b1 100644 --- a/spec/Looker.3.1.oas.json +++ b/spec/Looker.3.1.oas.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "version": "3.1.0", - "x-looker-release-version": "21.16.0", + "x-looker-release-version": "21.18.0", "title": "Looker API 3.1 Reference", "description": "### Authorization\n\nThe classic method of API authorization uses Looker **API3** credentials for authorization and access control.\nLooker admins can create API3 credentials on Looker's **Admin/Users** page.\n\nAPI 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests.\n\nFor details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization).\n\n\n### API Explorer\n\nThe API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs.\nIt is a replacement for the 'api-docs' page currently provided on Looker instances.\n\nFor details, see the [API Explorer documentation](https://looker.com/docs/r/api/explorer).\n\n\n### Looker Language SDKs\n\nThe Looker API is a RESTful system that should be usable by any programming language capable of making\nHTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker\nhas an OpenSource [sdk-codegen project](https://github.com/looker-open-source/sdk-codegen) that provides several\nlanguage SDKs. Language SDKs generated by `sdk-codegen` have an Authentication manager that can automatically\nauthenticate API requests when needed.\n\nFor details on available Looker SDKs, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks).\n\n\n### API Versioning\n\nFuture releases of Looker expand the latest API version release-by-release to securely expose more and more of the core\npower of the Looker platform to API client applications. API endpoints marked as \"beta\" may receive breaking changes without\nwarning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking\nchanges in future releases.\n\nFor details, see [Looker API Versioning](https://looker.com/docs/r/api/versioning).\n\n\n### Try It Out!\n\nThis section describes the existing 'api-docs' page available on Looker instances. We recommend using the\n[API Explorer](https://looker.com/docs/r/api/explorer) instead.\n\nThe 'api-docs' page served by the Looker instance includes 'Try It Out!' buttons for each API method. After logging\nin with API3 credentials, you can use the \"Try It Out!\" buttons to call the API directly from the documentation\npage to interactively explore API features and responses.\n\n**NOTE**! With great power comes great responsibility: The \"Try It Out!\" button makes API calls to your live Looker\ninstance. Be especially careful with destructive API operations such as `delete_user` or similar.\nThere is no \"undo\" for API operations. (API Explorer's \"Run It\" feature requires a check mark before running\nAPI operations that can change data.)\n\n\n### In This Release\n\nThe following are a few examples of noteworthy items that have changed between API 3.0 and API 3.1.\nFor more comprehensive coverage of API changes, please see the release notes for your Looker release.\n\n### Examples of new things added in API 3.1 (compared to API 3.0):\n\n* [Dashboard construction](#!/3.1/Dashboard/) APIs\n* [Themes](#!/3.1/Theme/) and [custom color collections](#!/3.1/ColorCollection) APIs\n* Create and run [SQL Runner](#!/3.1/Query/run_sql_query) queries\n* Create and run [merged results](#!/3.1/Query/create_merge_query) queries\n* Create and modify [dashboard filters](#!/3.1/Dashboard/create_dashboard_filter)\n* Create and modify [password requirements](#!/3.1/Auth/password_config)\n\n### Deprecated in API 3.0\n\nThe following functions and properties have been deprecated in API 3.0. They continue to exist and work in API 3.0\nfor the next several Looker releases but they have not been carried forward to API 3.1:\n\n* Dashboard Prefetch functions\n* User access_filter functions\n* User API 1.0 credentials functions\n* Space.is_root and Space.is_user_root properties. Use Space.is_shared_root and Space.is_users_root instead.\n\n### Semantic changes in API 3.1:\n\n* [all_looks()](#!/3.1/Look/all_looks) no longer includes soft-deleted looks, matching [all_dashboards()](#!/3.1/Dashboard/all_dashboards) behavior.\nYou can find soft-deleted looks using [search_looks()](#!/3.1/Look/search_looks) with the `deleted` param set to True.\n* [all_spaces()](#!/3.1/Space/all_spaces) no longer includes duplicate items\n* [search_users()](#!/3.1/User/search_users) no longer accepts Y,y,1,0,N,n for Boolean params, only \"true\" and \"false\".\n* For greater client and network compatibility, [render_task_results](#!/3.1/RenderTask/render_task_results) now returns\nHTTP status **202 Accepted** instead of HTTP status **102 Processing**\n* [all_running_queries()](#!/3.1/Query/all_running_queries) and [kill_query](#!/3.1/Query/kill_query) functions have moved into the [Query](#!/3.1/Query/) function group.\n\nThe API Explorer can be used to [interactively compare](https://looker.com/docs/r/api/explorer#comparing_api_versions) the differences between API 3.1 and 4.0.\n\n\n### API and SDK Support Policies\n\nLooker API versions and language SDKs have varying support levels. Please read the API and SDK\n[support policies](https://looker.com/docs/r/api/support-policy) for more information.\n\n\n", "contact": { @@ -30991,6 +30991,32 @@ "description": "Time last viewed in the Looker web UI", "nullable": true }, + "updated_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "Time that the Dashboard was most recently updated.", + "nullable": true + }, + "last_updater_id": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Id of User that most recently updated the dashboard.", + "nullable": true + }, + "last_updater_name": { + "type": "string", + "readOnly": true, + "description": "Name of User that most recently updated the dashboard.", + "nullable": true + }, + "user_name": { + "type": "string", + "readOnly": true, + "description": "Name of User that created the dashboard.", + "nullable": true + }, "load_configuration": { "type": "string", "description": "configuration option that governs how dashboard loading will happen.", @@ -37189,6 +37215,12 @@ "description": "Id of query to render", "nullable": true }, + "dashboard_element_id": { + "type": "string", + "readOnly": true, + "description": "Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id", + "nullable": true + }, "query_runtime": { "type": "number", "format": "double", diff --git a/spec/Looker.4.0.json b/spec/Looker.4.0.json index d1af922f6..922e9b9f2 100644 --- a/spec/Looker.4.0.json +++ b/spec/Looker.4.0.json @@ -1,8 +1,8 @@ { "swagger": "2.0", "info": { - "version": "4.0.21.16", - "x-looker-release-version": "21.16.0", + "version": "4.0.21.18", + "x-looker-release-version": "21.18.0", "title": "Looker API 4.0 (Beta) Reference", "description": "\nWelcome to the future! API 4.0 co-exists with APIs 3.1 and 3.0. (3.0 should no longer be used.)\nThe \"beta\" tag means updates for API 4.0 may include breaking changes, but as always we will work to minimize them.\n\n### Authorization\n\nThe classic method of API authorization uses Looker **API3** credentials for authorization and access control.\nLooker admins can create API3 credentials on Looker's **Admin/Users** page.\n\nAPI 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests.\n\nFor details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization).\n\n\n### API Explorer\n\nThe API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs.\nIt is a replacement for the 'api-docs' page currently provided on Looker instances.\n\nFor details, see the [API Explorer documentation](https://looker.com/docs/r/api/explorer).\n\n\n### Looker Language SDKs\n\nThe Looker API is a RESTful system that should be usable by any programming language capable of making\nHTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker\nhas an OpenSource [sdk-codegen project](https://github.com/looker-open-source/sdk-codegen) that provides several\nlanguage SDKs. Language SDKs generated by `sdk-codegen` have an Authentication manager that can automatically\nauthenticate API requests when needed.\n\nFor details on available Looker SDKs, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks).\n\n\n### API Versioning\n\nFuture releases of Looker expand the latest API version release-by-release to securely expose more and more of the core\npower of the Looker platform to API client applications. API endpoints marked as \"beta\" may receive breaking changes without\nwarning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking\nchanges in future releases.\n\nFor details, see [Looker API Versioning](https://looker.com/docs/r/api/versioning).\n\n\n### In This Release\n\nAPI 4.0 version was introduced so we can make adjustments to API functions, parameters, and response types to\nfix bugs and inconsistencies. These changes fall outside the bounds of non-breaking additive changes we can\nmake to our stable API 3.1.\n\nOne benefit of these type adjustments in API 4.0 is dramatically better support for strongly\ntyped languages like TypeScript, Kotlin, Swift, Go, C#, and more.\n\nWhile API 3.1 is still the de-facto Looker API (\"current\", \"stable\", \"default\", etc), the bulk\nof our development activity has shifted to API 4.0, where all new features are added.\n\nThe API Explorer can be used to [interactively compare](https://looker.com/docs/r/api/explorer#comparing_api_versions) the differences between API 3.1 and 4.0.\n\n\n### API and SDK Support Policies\n\nLooker API versions and language SDKs have varying support levels. Please read the API and SDK\n[support policies](https://looker.com/docs/r/api/support-policy) for more information.\n\n\n", "contact": { @@ -1288,7 +1288,7 @@ ], "operationId": "update_alert_field", "summary": "Update select fields on an alert", - "description": "### Update select alert fields\n# Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold`\n#\n", + "description": "### Update select alert fields\n# Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold`\n#\n", "parameters": [ { "name": "alert_id", @@ -1304,7 +1304,7 @@ "description": "Alert", "required": true, "schema": { - "$ref": "#/definitions/Alert" + "$ref": "#/definitions/AlertPatch" } } ], @@ -23819,7 +23819,11 @@ "x-looker-nullable": true } }, - "x-looker-status": "beta" + "x-looker-status": "beta", + "required": [ + "field_name", + "field_value" + ] }, "AlertAppliedDashboardFilter": { "properties": { @@ -23845,7 +23849,12 @@ "x-looker-nullable": true } }, - "x-looker-status": "beta" + "x-looker-status": "beta", + "required": [ + "filter_title", + "field_name", + "filter_value" + ] }, "AlertField": { "properties": { @@ -23868,7 +23877,11 @@ "x-looker-nullable": true } }, - "x-looker-status": "beta" + "x-looker-status": "beta", + "required": [ + "title", + "name" + ] }, "AlertConditionState": { "properties": { @@ -23950,13 +23963,13 @@ "type": "boolean", "readOnly": true, "description": "Whether or not the user follows this alert.", - "x-looker-nullable": true + "x-looker-nullable": false }, "followable": { "type": "boolean", "readOnly": true, "description": "Whether or not the alert is followable", - "x-looker-nullable": true + "x-looker-nullable": false }, "id": { "type": "integer", @@ -23970,6 +23983,11 @@ "description": "Whether or not the alert is disabled", "x-looker-nullable": false }, + "disabled_reason": { + "type": "string", + "description": "Reason for disabling alert", + "x-looker-nullable": true + }, "is_public": { "type": "boolean", "description": "Whether or not the alert is public", @@ -24029,7 +24047,15 @@ "x-looker-nullable": true } }, - "x-looker-status": "beta" + "x-looker-status": "beta", + "required": [ + "comparison_type", + "cron", + "destinations", + "field", + "owner_id", + "threshold" + ] }, "AlertDestination": { "properties": { @@ -24063,6 +24089,38 @@ "destination_type" ] }, + "AlertPatch": { + "properties": { + "owner_id": { + "type": "integer", + "format": "int64", + "description": "New owner ID of the alert", + "x-looker-nullable": true + }, + "is_disabled": { + "type": "boolean", + "description": "Set alert enabled or disabled", + "x-looker-nullable": true + }, + "disabled_reason": { + "type": "string", + "description": "The reason this alert is disabled", + "x-looker-nullable": true + }, + "is_public": { + "type": "boolean", + "description": "Set alert public or private", + "x-looker-nullable": true + }, + "threshold": { + "type": "number", + "format": "double", + "description": "New threshold value", + "x-looker-nullable": true + } + }, + "x-looker-status": "beta" + }, "ApiSession": { "properties": { "can": { @@ -26836,6 +26894,32 @@ "description": "Time last viewed in the Looker web UI", "x-looker-nullable": true }, + "updated_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "Time that the Dashboard was most recently updated.", + "x-looker-nullable": true + }, + "last_updater_id": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Id of User that most recently updated the dashboard.", + "x-looker-nullable": true + }, + "last_updater_name": { + "type": "string", + "readOnly": true, + "description": "Name of User that most recently updated the dashboard.", + "x-looker-nullable": true + }, + "user_name": { + "type": "string", + "readOnly": true, + "description": "Name of User that created the dashboard.", + "x-looker-nullable": true + }, "load_configuration": { "type": "string", "description": "configuration option that governs how dashboard loading will happen.", @@ -27231,8 +27315,7 @@ "x-looker-nullable": true }, "port": { - "type": "integer", - "format": "int64", + "type": "string", "description": "Port number on server", "x-looker-nullable": true }, @@ -33367,6 +33450,12 @@ "description": "Id of query to render", "x-looker-nullable": true }, + "dashboard_element_id": { + "type": "string", + "readOnly": true, + "description": "Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id", + "x-looker-nullable": true + }, "query_runtime": { "type": "number", "format": "double", diff --git a/spec/Looker.4.0.oas.json b/spec/Looker.4.0.oas.json index 5d1cf14c0..86c483457 100644 --- a/spec/Looker.4.0.oas.json +++ b/spec/Looker.4.0.oas.json @@ -1,8 +1,8 @@ { "openapi": "3.0.0", "info": { - "version": "4.0.21.16", - "x-looker-release-version": "21.16.0", + "version": "4.0.21.18", + "x-looker-release-version": "21.18.0", "title": "Looker API 4.0 (Beta) Reference", "description": "\nWelcome to the future! API 4.0 co-exists with APIs 3.1 and 3.0. (3.0 should no longer be used.)\nThe \"beta\" tag means updates for API 4.0 may include breaking changes, but as always we will work to minimize them.\n\n### Authorization\n\nThe classic method of API authorization uses Looker **API3** credentials for authorization and access control.\nLooker admins can create API3 credentials on Looker's **Admin/Users** page.\n\nAPI 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests.\n\nFor details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization).\n\n\n### API Explorer\n\nThe API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs.\nIt is a replacement for the 'api-docs' page currently provided on Looker instances.\n\nFor details, see the [API Explorer documentation](https://looker.com/docs/r/api/explorer).\n\n\n### Looker Language SDKs\n\nThe Looker API is a RESTful system that should be usable by any programming language capable of making\nHTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker\nhas an OpenSource [sdk-codegen project](https://github.com/looker-open-source/sdk-codegen) that provides several\nlanguage SDKs. Language SDKs generated by `sdk-codegen` have an Authentication manager that can automatically\nauthenticate API requests when needed.\n\nFor details on available Looker SDKs, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks).\n\n\n### API Versioning\n\nFuture releases of Looker expand the latest API version release-by-release to securely expose more and more of the core\npower of the Looker platform to API client applications. API endpoints marked as \"beta\" may receive breaking changes without\nwarning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking\nchanges in future releases.\n\nFor details, see [Looker API Versioning](https://looker.com/docs/r/api/versioning).\n\n\n### In This Release\n\nAPI 4.0 version was introduced so we can make adjustments to API functions, parameters, and response types to\nfix bugs and inconsistencies. These changes fall outside the bounds of non-breaking additive changes we can\nmake to our stable API 3.1.\n\nOne benefit of these type adjustments in API 4.0 is dramatically better support for strongly\ntyped languages like TypeScript, Kotlin, Swift, Go, C#, and more.\n\nWhile API 3.1 is still the de-facto Looker API (\"current\", \"stable\", \"default\", etc), the bulk\nof our development activity has shifted to API 4.0, where all new features are added.\n\nThe API Explorer can be used to [interactively compare](https://looker.com/docs/r/api/explorer#comparing_api_versions) the differences between API 3.1 and 4.0.\n\n\n### API and SDK Support Policies\n\nLooker API versions and language SDKs have varying support levels. Please read the API and SDK\n[support policies](https://looker.com/docs/r/api/support-policy) for more information.\n\n\n", "contact": { @@ -1874,7 +1874,7 @@ ], "operationId": "update_alert_field", "summary": "Update select fields on an alert", - "description": "### Update select alert fields\n# Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold`\n#\n", + "description": "### Update select alert fields\n# Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold`\n#\n", "parameters": [ { "name": "alert_id", @@ -1955,7 +1955,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Alert" + "$ref": "#/components/schemas/AlertPatch" } } }, @@ -32351,7 +32351,11 @@ "nullable": true } }, - "x-looker-status": "beta" + "x-looker-status": "beta", + "required": [ + "field_name", + "field_value" + ] }, "AlertAppliedDashboardFilter": { "properties": { @@ -32377,7 +32381,12 @@ "nullable": true } }, - "x-looker-status": "beta" + "x-looker-status": "beta", + "required": [ + "filter_title", + "field_name", + "filter_value" + ] }, "AlertField": { "properties": { @@ -32400,7 +32409,11 @@ "nullable": true } }, - "x-looker-status": "beta" + "x-looker-status": "beta", + "required": [ + "title", + "name" + ] }, "AlertConditionState": { "properties": { @@ -32480,13 +32493,13 @@ "type": "boolean", "readOnly": true, "description": "Whether or not the user follows this alert.", - "nullable": true + "nullable": false }, "followable": { "type": "boolean", "readOnly": true, "description": "Whether or not the alert is followable", - "nullable": true + "nullable": false }, "id": { "type": "integer", @@ -32500,6 +32513,11 @@ "description": "Whether or not the alert is disabled", "nullable": false }, + "disabled_reason": { + "type": "string", + "description": "Reason for disabling alert", + "nullable": true + }, "is_public": { "type": "boolean", "description": "Whether or not the alert is public", @@ -32556,7 +32574,15 @@ "$ref": "#/components/schemas/AlertConditionState" } }, - "x-looker-status": "beta" + "x-looker-status": "beta", + "required": [ + "comparison_type", + "cron", + "destinations", + "field", + "owner_id", + "threshold" + ] }, "AlertDestination": { "properties": { @@ -32590,6 +32616,38 @@ "destination_type" ] }, + "AlertPatch": { + "properties": { + "owner_id": { + "type": "integer", + "format": "int64", + "description": "New owner ID of the alert", + "nullable": true + }, + "is_disabled": { + "type": "boolean", + "description": "Set alert enabled or disabled", + "nullable": true + }, + "disabled_reason": { + "type": "string", + "description": "The reason this alert is disabled", + "nullable": true + }, + "is_public": { + "type": "boolean", + "description": "Set alert public or private", + "nullable": true + }, + "threshold": { + "type": "number", + "format": "double", + "description": "New threshold value", + "nullable": true + } + }, + "x-looker-status": "beta" + }, "ApiSession": { "properties": { "can": { @@ -35321,6 +35379,32 @@ "description": "Time last viewed in the Looker web UI", "nullable": true }, + "updated_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "Time that the Dashboard was most recently updated.", + "nullable": true + }, + "last_updater_id": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Id of User that most recently updated the dashboard.", + "nullable": true + }, + "last_updater_name": { + "type": "string", + "readOnly": true, + "description": "Name of User that most recently updated the dashboard.", + "nullable": true + }, + "user_name": { + "type": "string", + "readOnly": true, + "description": "Name of User that created the dashboard.", + "nullable": true + }, "load_configuration": { "type": "string", "description": "configuration option that governs how dashboard loading will happen.", @@ -35702,8 +35786,7 @@ "nullable": true }, "port": { - "type": "integer", - "format": "int64", + "type": "string", "description": "Port number on server", "nullable": true }, @@ -41788,6 +41871,12 @@ "description": "Id of query to render", "nullable": true }, + "dashboard_element_id": { + "type": "string", + "readOnly": true, + "description": "Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id", + "nullable": true + }, "query_runtime": { "type": "number", "format": "double", diff --git a/swift/looker/rtl/constants.swift b/swift/looker/rtl/constants.swift index b19d6031b..6c3bd3ef5 100644 --- a/swift/looker/rtl/constants.swift +++ b/swift/looker/rtl/constants.swift @@ -51,7 +51,7 @@ extension String { } public struct Constants { - public static let lookerVersion = "21.16" + public static let lookerVersion = "21.18" public static let apiVersion = "4.0" public static let defaultApiVersion = "4.0" // Swift requires API 4.0 public static let sdkVersion = #"\#(apiVersion).\#(lookerVersion)"# diff --git a/swift/looker/sdk/methods.swift b/swift/looker/sdk/methods.swift index 018f82057..b5d59fde3 100644 --- a/swift/looker/sdk/methods.swift +++ b/swift/looker/sdk/methods.swift @@ -135,7 +135,7 @@ open class LookerSDK: APIMethods { /** * ### Update select alert fields - * # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + * # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` * # * * PATCH /alerts/{alert_id} -> Alert @@ -146,9 +146,9 @@ open class LookerSDK: APIMethods { */ _ alert_id: Int64, /** - * @param {WriteAlert} body + * @param {AlertPatch} body */ - _ body: WriteAlert, + _ body: AlertPatch, options: ITransportSettings? = nil ) -> SDKResponse { let path_alert_id = encodeParam(alert_id) diff --git a/swift/looker/sdk/models.swift b/swift/looker/sdk/models.swift index f38fa6369..3a8815636 100644 --- a/swift/looker/sdk/models.swift +++ b/swift/looker/sdk/models.swift @@ -25,7 +25,7 @@ */ /** - * 297 API models: 220 Spec, 0 Request, 57 Write, 20 Enum + * 298 API models: 221 Spec, 0 Request, 57 Write, 20 Enum */ @@ -78,6 +78,7 @@ public struct Alert: SDKModel { case followable case id case is_disabled + case disabled_reason case is_public case investigative_content_type case _investigative_content_id = "investigative_content_id" @@ -97,12 +98,12 @@ public struct Alert: SDKModel { /** * This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". */ - public var comparison_type: ComparisonType? + public var comparison_type: ComparisonType /** * Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals */ - public var cron: String? + public var cron: String /** * An optional, user-defined title for the alert @@ -122,9 +123,9 @@ public struct Alert: SDKModel { /** * Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` */ - public var destinations: [AlertDestination]? + public var destinations: [AlertDestination] - public var field: AlertField? + public var field: AlertField /** * Whether or not the user follows this alert. (read-only) @@ -146,6 +147,11 @@ public struct Alert: SDKModel { */ public var is_disabled: Bool? + /** + * Reason for disabling alert + */ + public var disabled_reason: String? + /** * Whether or not the alert is public */ @@ -191,7 +197,7 @@ public struct Alert: SDKModel { /** * User id of alert owner */ - public var owner_id: Int64? + public var owner_id: Int64 /** * Alert owner's display name (read-only) @@ -201,11 +207,11 @@ public struct Alert: SDKModel { /** * Value of the alert threshold */ - public var threshold: Double? + public var threshold: Double public var time_series_condition_state: AlertConditionState? - public init(applied_dashboard_filters: [AlertAppliedDashboardFilter]? = nil, comparison_type: ComparisonType? = nil, cron: String? = nil, custom_title: String? = nil, dashboard_element_id: Int64? = nil, description: String? = nil, destinations: [AlertDestination]? = nil, field: AlertField? = nil, followed: Bool? = nil, followable: Bool? = nil, id: Int64? = nil, is_disabled: Bool? = nil, is_public: Bool? = nil, investigative_content_type: InvestigativeContentType? = nil, investigative_content_id: String? = nil, investigative_content_title: String? = nil, lookml_dashboard_id: String? = nil, lookml_link_id: String? = nil, owner_id: Int64? = nil, owner_display_name: String? = nil, threshold: Double? = nil, time_series_condition_state: AlertConditionState? = nil) { + public init(applied_dashboard_filters: [AlertAppliedDashboardFilter]? = nil, comparison_type: ComparisonType, cron: String, custom_title: String? = nil, dashboard_element_id: Int64? = nil, description: String? = nil, destinations: [AlertDestination], field: AlertField, followed: Bool? = nil, followable: Bool? = nil, id: Int64? = nil, is_disabled: Bool? = nil, disabled_reason: String? = nil, is_public: Bool? = nil, investigative_content_type: InvestigativeContentType? = nil, investigative_content_id: String? = nil, investigative_content_title: String? = nil, lookml_dashboard_id: String? = nil, lookml_link_id: String? = nil, owner_id: Int64, owner_display_name: String? = nil, threshold: Double, time_series_condition_state: AlertConditionState? = nil) { self.applied_dashboard_filters = applied_dashboard_filters self.comparison_type = comparison_type self.cron = cron @@ -218,6 +224,7 @@ public struct Alert: SDKModel { self.followable = followable self.id = id self.is_disabled = is_disabled + self.disabled_reason = disabled_reason self.is_public = is_public self.investigative_content_type = investigative_content_type self._investigative_content_id = investigative_content_id.map(AnyString.init) @@ -230,36 +237,44 @@ public struct Alert: SDKModel { self.time_series_condition_state = time_series_condition_state } + public init(applied_dashboard_filters: [AlertAppliedDashboardFilter]? = nil, _ comparison_type: ComparisonType, _ cron: String, custom_title: String? = nil, dashboard_element_id: Int64? = nil, description: String? = nil, _ destinations: [AlertDestination], _ field: AlertField, followed: Bool? = nil, followable: Bool? = nil, id: Int64? = nil, is_disabled: Bool? = nil, disabled_reason: String? = nil, is_public: Bool? = nil, investigative_content_type: InvestigativeContentType? = nil, investigative_content_id: String? = nil, investigative_content_title: String? = nil, lookml_dashboard_id: String? = nil, lookml_link_id: String? = nil, _ owner_id: Int64, owner_display_name: String? = nil, _ threshold: Double, time_series_condition_state: AlertConditionState? = nil) { + self.init(applied_dashboard_filters: applied_dashboard_filters, comparison_type: comparison_type, cron: cron, custom_title: custom_title, dashboard_element_id: dashboard_element_id, description: description, destinations: destinations, field: field, followed: followed, followable: followable, id: id, is_disabled: is_disabled, disabled_reason: disabled_reason, is_public: is_public, investigative_content_type: investigative_content_type, investigative_content_id: investigative_content_id, investigative_content_title: investigative_content_title, lookml_dashboard_id: lookml_dashboard_id, lookml_link_id: lookml_link_id, owner_id: owner_id, owner_display_name: owner_display_name, threshold: threshold, time_series_condition_state: time_series_condition_state) + } + } public struct AlertAppliedDashboardFilter: SDKModel { /** * Field Title. Refer to `DashboardFilter.title` in [DashboardFilter](#!/types/DashboardFilter). Example `Name` */ - public var filter_title: String? + public var filter_title: String /** * Field Name. Refer to `DashboardFilter.dimension` in [DashboardFilter](#!/types/DashboardFilter). Example `distribution_centers.name` */ - public var field_name: String? + public var field_name: String /** * Field Value. [Filter Expressions](https://docs.looker.com/reference/filter-expressions). Example `Los Angeles CA` */ - public var filter_value: String? + public var filter_value: String /** * Human Readable Filter Description. This may be null or auto-generated. Example `is Los Angeles CA` (read-only) */ public var filter_description: String? - public init(filter_title: String? = nil, field_name: String? = nil, filter_value: String? = nil, filter_description: String? = nil) { + public init(filter_title: String, field_name: String, filter_value: String, filter_description: String? = nil) { self.filter_title = filter_title self.field_name = field_name self.filter_value = filter_value self.filter_description = filter_description } + public init(_ filter_title: String, _ field_name: String, _ filter_value: String, filter_description: String? = nil) { + self.init(filter_title: filter_title, field_name: field_name, filter_value: filter_value, filter_description: filter_description) + } + } public struct AlertConditionState: SDKModel { @@ -342,48 +357,92 @@ public struct AlertField: SDKModel { /** * Field's title. Usually auto-generated to reflect field name and its filters */ - public var title: String? + public var title: String /** * Field's name. Has the format `.` Refer to [docs](https://docs.looker.com/sharing-and-publishing/creating-alerts) for more details */ - public var name: String? + public var name: String /** * (Optional / Advance Use) List of fields filter. This further restricts the alert to certain dashboard element's field values. This can be used on top of dashboard filters `applied_dashboard_filters`. To keep thing simple, it's suggested to just use dashboard filters. Example: `{ 'title': '12 Number on Hand', 'name': 'inventory_items.number_on_hand', 'filter': [{ 'field_name': 'inventory_items.id', 'field_value': 12, 'filter_value': null }] }` */ public var filter: [AlertFieldFilter]? - public init(title: String? = nil, name: String? = nil, filter: [AlertFieldFilter]? = nil) { + public init(title: String, name: String, filter: [AlertFieldFilter]? = nil) { self.title = title self.name = name self.filter = filter } + public init(_ title: String, _ name: String, filter: [AlertFieldFilter]? = nil) { + self.init(title: title, name: name, filter: filter) + } + } public struct AlertFieldFilter: SDKModel { /** * Field Name. Has format `.` */ - public var field_name: String? + public var field_name: String /** * Field Value. Depends on the type of field - numeric or string. For [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type, it's a list of floats. Example `[1.0, 56.0]` */ - public var field_value: AnyCodable? + public var field_value: AnyCodable /** * Filter Value. Usually null except for [location](https://docs.looker.com/reference/field-reference/dimension-type-reference#location) type. It'll be a string of lat,long ie `'1.0,56.0'` */ public var filter_value: String? - public init(field_name: String? = nil, field_value: AnyCodable? = nil, filter_value: String? = nil) { + public init(field_name: String, field_value: AnyCodable, filter_value: String? = nil) { self.field_name = field_name self.field_value = field_value self.filter_value = filter_value } + public init(_ field_name: String, _ field_value: AnyCodable, filter_value: String? = nil) { + self.init(field_name: field_name, field_value: field_value, filter_value: filter_value) + } + +} + +public struct AlertPatch: SDKModel { + /** + * New owner ID of the alert + */ + public var owner_id: Int64? + + /** + * Set alert enabled or disabled + */ + public var is_disabled: Bool? + + /** + * The reason this alert is disabled + */ + public var disabled_reason: String? + + /** + * Set alert public or private + */ + public var is_public: Bool? + + /** + * New threshold value + */ + public var threshold: Double? + + public init(owner_id: Int64? = nil, is_disabled: Bool? = nil, disabled_reason: String? = nil, is_public: Bool? = nil, threshold: Double? = nil) { + self.owner_id = owner_id + self.is_disabled = is_disabled + self.disabled_reason = disabled_reason + self.is_public = is_public + self.threshold = threshold + } + } /** @@ -3144,6 +3203,10 @@ public struct Dashboard: SDKModel { case filters_bar_collapsed case last_accessed_at case last_viewed_at + case updated_at + case last_updater_id + case last_updater_name + case user_name case load_configuration case _lookml_link_id = "lookml_link_id" case show_filters_bar @@ -3310,6 +3373,26 @@ public struct Dashboard: SDKModel { */ public var last_viewed_at: Date? + /** + * Time that the Dashboard was most recently updated. (read-only) + */ + public var updated_at: Date? + + /** + * Id of User that most recently updated the dashboard. (read-only) + */ + public var last_updater_id: Int64? + + /** + * Name of User that most recently updated the dashboard. (read-only) + */ + public var last_updater_name: String? + + /** + * Name of User that created the dashboard. (read-only) + */ + public var user_name: String? + /** * configuration option that governs how dashboard loading will happen. */ @@ -3375,7 +3458,7 @@ public struct Dashboard: SDKModel { */ public var url: String? - public init(can: StringDictionary? = nil, content_favorite_id: Int64? = nil, content_metadata_id: Int64? = nil, description: String? = nil, hidden: Bool? = nil, id: String? = nil, model: LookModel? = nil, query_timezone: String? = nil, readonly: Bool? = nil, refresh_interval: String? = nil, refresh_interval_to_i: Int64? = nil, folder: FolderBase? = nil, title: String? = nil, user_id: Int64? = nil, slug: String? = nil, preferred_viewer: String? = nil, alert_sync_with_dashboard_filter_enabled: Bool? = nil, background_color: String? = nil, created_at: Date? = nil, crossfilter_enabled: Bool? = nil, dashboard_elements: [DashboardElement]? = nil, dashboard_filters: [DashboardFilter]? = nil, dashboard_layouts: [DashboardLayout]? = nil, deleted: Bool? = nil, deleted_at: Date? = nil, deleter_id: Int64? = nil, edit_uri: String? = nil, favorite_count: Int64? = nil, filters_bar_collapsed: Bool? = nil, last_accessed_at: Date? = nil, last_viewed_at: Date? = nil, load_configuration: String? = nil, lookml_link_id: String? = nil, show_filters_bar: Bool? = nil, show_title: Bool? = nil, folder_id: String? = nil, text_tile_text_color: String? = nil, tile_background_color: String? = nil, tile_text_color: String? = nil, title_color: String? = nil, view_count: Int64? = nil, appearance: DashboardAppearance? = nil, url: String? = nil) { + public init(can: StringDictionary? = nil, content_favorite_id: Int64? = nil, content_metadata_id: Int64? = nil, description: String? = nil, hidden: Bool? = nil, id: String? = nil, model: LookModel? = nil, query_timezone: String? = nil, readonly: Bool? = nil, refresh_interval: String? = nil, refresh_interval_to_i: Int64? = nil, folder: FolderBase? = nil, title: String? = nil, user_id: Int64? = nil, slug: String? = nil, preferred_viewer: String? = nil, alert_sync_with_dashboard_filter_enabled: Bool? = nil, background_color: String? = nil, created_at: Date? = nil, crossfilter_enabled: Bool? = nil, dashboard_elements: [DashboardElement]? = nil, dashboard_filters: [DashboardFilter]? = nil, dashboard_layouts: [DashboardLayout]? = nil, deleted: Bool? = nil, deleted_at: Date? = nil, deleter_id: Int64? = nil, edit_uri: String? = nil, favorite_count: Int64? = nil, filters_bar_collapsed: Bool? = nil, last_accessed_at: Date? = nil, last_viewed_at: Date? = nil, updated_at: Date? = nil, last_updater_id: Int64? = nil, last_updater_name: String? = nil, user_name: String? = nil, load_configuration: String? = nil, lookml_link_id: String? = nil, show_filters_bar: Bool? = nil, show_title: Bool? = nil, folder_id: String? = nil, text_tile_text_color: String? = nil, tile_background_color: String? = nil, tile_text_color: String? = nil, title_color: String? = nil, view_count: Int64? = nil, appearance: DashboardAppearance? = nil, url: String? = nil) { self.can = can self.content_favorite_id = content_favorite_id self.content_metadata_id = content_metadata_id @@ -3407,6 +3490,10 @@ public struct Dashboard: SDKModel { self.filters_bar_collapsed = filters_bar_collapsed self.last_accessed_at = last_accessed_at self.last_viewed_at = last_viewed_at + self.updated_at = updated_at + self.last_updater_id = last_updater_id + self.last_updater_name = last_updater_name + self.user_name = user_name self.load_configuration = load_configuration self._lookml_link_id = lookml_link_id.map(AnyString.init) self.show_filters_bar = show_filters_bar @@ -4497,7 +4584,7 @@ public struct DBConnection: SDKModel { /** * Port number on server */ - public var port: Int64? + public var port: String? /** * Username for server authentication @@ -4679,7 +4766,7 @@ public struct DBConnection: SDKModel { */ public var always_retry_failed_builds: Bool? - public init(can: StringDictionary? = nil, name: String? = nil, dialect: Dialect? = nil, snippets: [Snippet]? = nil, pdts_enabled: Bool? = nil, host: String? = nil, port: Int64? = nil, username: String? = nil, password: String? = nil, uses_oauth: Bool? = nil, certificate: String? = nil, file_type: String? = nil, database: String? = nil, db_timezone: String? = nil, query_timezone: String? = nil, schema: String? = nil, max_connections: Int64? = nil, max_billing_gigabytes: String? = nil, ssl: Bool? = nil, verify_ssl: Bool? = nil, tmp_db_name: String? = nil, jdbc_additional_params: String? = nil, pool_timeout: Int64? = nil, dialect_name: String? = nil, created_at: String? = nil, user_id: String? = nil, example: Bool? = nil, user_db_credentials: Bool? = nil, user_attribute_fields: [String]? = nil, maintenance_cron: String? = nil, last_regen_at: String? = nil, last_reap_at: String? = nil, sql_runner_precache_tables: Bool? = nil, sql_writing_with_info_schema: Bool? = nil, after_connect_statements: String? = nil, pdt_context_override: DBConnectionOverride? = nil, managed: Bool? = nil, tunnel_id: String? = nil, pdt_concurrency: Int64? = nil, disable_context_comment: Bool? = nil, oauth_application_id: Int64? = nil, always_retry_failed_builds: Bool? = nil) { + public init(can: StringDictionary? = nil, name: String? = nil, dialect: Dialect? = nil, snippets: [Snippet]? = nil, pdts_enabled: Bool? = nil, host: String? = nil, port: String? = nil, username: String? = nil, password: String? = nil, uses_oauth: Bool? = nil, certificate: String? = nil, file_type: String? = nil, database: String? = nil, db_timezone: String? = nil, query_timezone: String? = nil, schema: String? = nil, max_connections: Int64? = nil, max_billing_gigabytes: String? = nil, ssl: Bool? = nil, verify_ssl: Bool? = nil, tmp_db_name: String? = nil, jdbc_additional_params: String? = nil, pool_timeout: Int64? = nil, dialect_name: String? = nil, created_at: String? = nil, user_id: String? = nil, example: Bool? = nil, user_db_credentials: Bool? = nil, user_attribute_fields: [String]? = nil, maintenance_cron: String? = nil, last_regen_at: String? = nil, last_reap_at: String? = nil, sql_runner_precache_tables: Bool? = nil, sql_writing_with_info_schema: Bool? = nil, after_connect_statements: String? = nil, pdt_context_override: DBConnectionOverride? = nil, managed: Bool? = nil, tunnel_id: String? = nil, pdt_concurrency: Int64? = nil, disable_context_comment: Bool? = nil, oauth_application_id: Int64? = nil, always_retry_failed_builds: Bool? = nil) { self.can = can self.name = name self.dialect = dialect @@ -11298,6 +11385,7 @@ public struct RenderTask: SDKModel { case look_id case _lookml_dashboard_id = "lookml_dashboard_id" case query_id + case _dashboard_element_id = "dashboard_element_id" case query_runtime case render_runtime case result_format @@ -11370,6 +11458,15 @@ public struct RenderTask: SDKModel { */ public var query_id: Int64? + private var _dashboard_element_id: AnyString? + /** + * Id of dashboard element to render: UDD dashboard element would be numeric and LookML dashboard element would be model_name::dashboard_title::lookml_link_id (read-only) + */ + public var dashboard_element_id: String? { + get { _dashboard_element_id?.value } + set { _dashboard_element_id = newValue.map(AnyString.init) } + } + /** * Number of seconds elapsed running queries (read-only) */ @@ -11410,7 +11507,7 @@ public struct RenderTask: SDKModel { */ public var width: Int64? - public init(can: StringDictionary? = nil, created_at: String? = nil, dashboard_filters: String? = nil, dashboard_id: Int64? = nil, dashboard_style: String? = nil, finalized_at: String? = nil, height: Int64? = nil, id: String? = nil, look_id: Int64? = nil, lookml_dashboard_id: String? = nil, query_id: Int64? = nil, query_runtime: Double? = nil, render_runtime: Double? = nil, result_format: String? = nil, runtime: Double? = nil, status: String? = nil, status_detail: String? = nil, user_id: Int64? = nil, width: Int64? = nil) { + public init(can: StringDictionary? = nil, created_at: String? = nil, dashboard_filters: String? = nil, dashboard_id: Int64? = nil, dashboard_style: String? = nil, finalized_at: String? = nil, height: Int64? = nil, id: String? = nil, look_id: Int64? = nil, lookml_dashboard_id: String? = nil, query_id: Int64? = nil, dashboard_element_id: String? = nil, query_runtime: Double? = nil, render_runtime: Double? = nil, result_format: String? = nil, runtime: Double? = nil, status: String? = nil, status_detail: String? = nil, user_id: Int64? = nil, width: Int64? = nil) { self.can = can self.created_at = created_at self.dashboard_filters = dashboard_filters @@ -11422,6 +11519,7 @@ public struct RenderTask: SDKModel { self.look_id = look_id self._lookml_dashboard_id = lookml_dashboard_id.map(AnyString.init) self.query_id = query_id + self._dashboard_element_id = dashboard_element_id.map(AnyString.init) self.query_runtime = query_runtime self.render_runtime = render_runtime self.result_format = result_format @@ -14458,6 +14556,7 @@ public struct WriteAlert: SDKModel { case destinations case field case is_disabled + case disabled_reason case is_public case investigative_content_type case _investigative_content_id = "investigative_content_id" @@ -14475,12 +14574,12 @@ public struct WriteAlert: SDKModel { /** * This property informs the check what kind of comparison we are performing. Only certain condition types are valid for time series alerts. For details, refer to [Setting Alert Conditions](https://docs.looker.com/sharing-and-publishing/creating-alerts#setting_alert_conditions) Valid values are: "EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL_TO", "LESS_THAN", "LESS_THAN_OR_EQUAL_TO", "INCREASES_BY", "DECREASES_BY", "CHANGES_BY". */ - public var comparison_type: ComparisonType? + public var comparison_type: ComparisonType /** * Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals */ - public var cron: String? + public var cron: String /** * An optional, user-defined title for the alert @@ -14500,15 +14599,20 @@ public struct WriteAlert: SDKModel { /** * Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]` */ - public var destinations: [AlertDestination]? + public var destinations: [AlertDestination] - public var field: AlertField? + public var field: AlertField /** * Whether or not the alert is disabled */ public var is_disabled: Bool? + /** + * Reason for disabling alert + */ + public var disabled_reason: String? + /** * Whether or not the alert is public */ @@ -14549,16 +14653,16 @@ public struct WriteAlert: SDKModel { /** * User id of alert owner */ - public var owner_id: Int64? + public var owner_id: Int64 /** * Value of the alert threshold */ - public var threshold: Double? + public var threshold: Double public var time_series_condition_state: AlertConditionState? - public init(applied_dashboard_filters: [AlertAppliedDashboardFilter]? = nil, comparison_type: ComparisonType? = nil, cron: String? = nil, custom_title: String? = nil, dashboard_element_id: Int64? = nil, description: String? = nil, destinations: [AlertDestination]? = nil, field: AlertField? = nil, is_disabled: Bool? = nil, is_public: Bool? = nil, investigative_content_type: InvestigativeContentType? = nil, investigative_content_id: String? = nil, lookml_dashboard_id: String? = nil, lookml_link_id: String? = nil, owner_id: Int64? = nil, threshold: Double? = nil, time_series_condition_state: AlertConditionState? = nil) { + public init(applied_dashboard_filters: [AlertAppliedDashboardFilter]? = nil, comparison_type: ComparisonType, cron: String, custom_title: String? = nil, dashboard_element_id: Int64? = nil, description: String? = nil, destinations: [AlertDestination], field: AlertField, is_disabled: Bool? = nil, disabled_reason: String? = nil, is_public: Bool? = nil, investigative_content_type: InvestigativeContentType? = nil, investigative_content_id: String? = nil, lookml_dashboard_id: String? = nil, lookml_link_id: String? = nil, owner_id: Int64, threshold: Double, time_series_condition_state: AlertConditionState? = nil) { self.applied_dashboard_filters = applied_dashboard_filters self.comparison_type = comparison_type self.cron = cron @@ -14568,6 +14672,7 @@ public struct WriteAlert: SDKModel { self.destinations = destinations self.field = field self.is_disabled = is_disabled + self.disabled_reason = disabled_reason self.is_public = is_public self.investigative_content_type = investigative_content_type self._investigative_content_id = investigative_content_id.map(AnyString.init) @@ -14578,6 +14683,10 @@ public struct WriteAlert: SDKModel { self.time_series_condition_state = time_series_condition_state } + public init(applied_dashboard_filters: [AlertAppliedDashboardFilter]? = nil, _ comparison_type: ComparisonType, _ cron: String, custom_title: String? = nil, dashboard_element_id: Int64? = nil, description: String? = nil, _ destinations: [AlertDestination], _ field: AlertField, is_disabled: Bool? = nil, disabled_reason: String? = nil, is_public: Bool? = nil, investigative_content_type: InvestigativeContentType? = nil, investigative_content_id: String? = nil, lookml_dashboard_id: String? = nil, lookml_link_id: String? = nil, _ owner_id: Int64, _ threshold: Double, time_series_condition_state: AlertConditionState? = nil) { + self.init(applied_dashboard_filters: applied_dashboard_filters, comparison_type: comparison_type, cron: cron, custom_title: custom_title, dashboard_element_id: dashboard_element_id, description: description, destinations: destinations, field: field, is_disabled: is_disabled, disabled_reason: disabled_reason, is_public: is_public, investigative_content_type: investigative_content_type, investigative_content_id: investigative_content_id, lookml_dashboard_id: lookml_dashboard_id, lookml_link_id: lookml_link_id, owner_id: owner_id, threshold: threshold, time_series_condition_state: time_series_condition_state) + } + } /** @@ -15121,7 +15230,7 @@ public struct WriteCredentialsEmail: SDKModel { /** * Dynamic writeable type for Dashboard removes: - * can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, view_count, url + * can, content_favorite_id, content_metadata_id, id, model, readonly, refresh_interval_to_i, user_id, created_at, dashboard_elements, dashboard_filters, dashboard_layouts, deleted_at, deleter_id, edit_uri, favorite_count, last_accessed_at, last_viewed_at, updated_at, last_updater_id, last_updater_name, user_name, view_count, url */ public struct WriteDashboard: SDKModel { @@ -15741,7 +15850,7 @@ public struct WriteDBConnection: SDKModel { /** * Port number on server */ - public var port: Int64? + public var port: String? /** * Username for server authentication @@ -15888,7 +15997,7 @@ public struct WriteDBConnection: SDKModel { */ public var always_retry_failed_builds: Bool? - public init(name: String? = nil, host: String? = nil, port: Int64? = nil, username: String? = nil, password: String? = nil, certificate: String? = nil, file_type: String? = nil, database: String? = nil, db_timezone: String? = nil, query_timezone: String? = nil, schema: String? = nil, max_connections: Int64? = nil, max_billing_gigabytes: String? = nil, ssl: Bool? = nil, verify_ssl: Bool? = nil, tmp_db_name: String? = nil, jdbc_additional_params: String? = nil, pool_timeout: Int64? = nil, dialect_name: String? = nil, user_db_credentials: Bool? = nil, user_attribute_fields: [String]? = nil, maintenance_cron: String? = nil, sql_runner_precache_tables: Bool? = nil, sql_writing_with_info_schema: Bool? = nil, after_connect_statements: String? = nil, pdt_context_override: WriteDBConnectionOverride? = nil, tunnel_id: String? = nil, pdt_concurrency: Int64? = nil, disable_context_comment: Bool? = nil, oauth_application_id: Int64? = nil, always_retry_failed_builds: Bool? = nil) { + public init(name: String? = nil, host: String? = nil, port: String? = nil, username: String? = nil, password: String? = nil, certificate: String? = nil, file_type: String? = nil, database: String? = nil, db_timezone: String? = nil, query_timezone: String? = nil, schema: String? = nil, max_connections: Int64? = nil, max_billing_gigabytes: String? = nil, ssl: Bool? = nil, verify_ssl: Bool? = nil, tmp_db_name: String? = nil, jdbc_additional_params: String? = nil, pool_timeout: Int64? = nil, dialect_name: String? = nil, user_db_credentials: Bool? = nil, user_attribute_fields: [String]? = nil, maintenance_cron: String? = nil, sql_runner_precache_tables: Bool? = nil, sql_writing_with_info_schema: Bool? = nil, after_connect_statements: String? = nil, pdt_context_override: WriteDBConnectionOverride? = nil, tunnel_id: String? = nil, pdt_concurrency: Int64? = nil, disable_context_comment: Bool? = nil, oauth_application_id: Int64? = nil, always_retry_failed_builds: Bool? = nil) { self.name = name self.host = host self.port = port diff --git a/swift/looker/sdk/streams.swift b/swift/looker/sdk/streams.swift index 75d07b74c..c8b8e3e62 100644 --- a/swift/looker/sdk/streams.swift +++ b/swift/looker/sdk/streams.swift @@ -133,7 +133,7 @@ open class LookerSDKStream: APIMethods { /** * ### Update select alert fields - * # Available fields: `owner_id`, `is_disabled`, `is_public`, `threshold` + * # Available fields: `owner_id`, `is_disabled`, `disabled_reason`, `is_public`, `threshold` * # * * PATCH /alerts/{alert_id} -> Alert @@ -144,9 +144,9 @@ open class LookerSDKStream: APIMethods { */ _ alert_id: Int64, /** - * @param {WriteAlert} body + * @param {AlertPatch} body */ - _ body: WriteAlert, + _ body: AlertPatch, options: ITransportSettings? = nil ) -> SDKResponse { let path_alert_id = encodeParam(alert_id)