Skip to content

Commit

Permalink
feat: Looker 21.18 bindings (#865)
Browse files Browse the repository at this point in the history
* updates for release 21.18

* fixed linting in typescript

* revert changes to .release-please-manifest.json
  • Loading branch information
drstrangelooker authored Oct 20, 2021
1 parent 7cfd21c commit fa98888
Show file tree
Hide file tree
Showing 35 changed files with 946 additions and 306 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codegen-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lerna-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tssdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ jobs:
- ubuntu
looker:
- '21_12'
- '21_14'
- '21_16'
- '21_18'

steps:
- name: Repo Checkout
Expand Down
2 changes: 1 addition & 1 deletion csharp/rtl/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
12 changes: 11 additions & 1 deletion csharp/sdk/3.1/models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,14 @@ public class Dashboard : SdkModel
public DateTime? last_accessed_at { get; set; } = null;
/// <summary>Time last viewed in the Looker web UI (read-only)</summary>
public DateTime? last_viewed_at { get; set; } = null;
/// <summary>Time that the Dashboard was most recently updated. (read-only)</summary>
public DateTime? updated_at { get; set; } = null;
/// <summary>Id of User that most recently updated the dashboard. (read-only)</summary>
public long? last_updater_id { get; set; } = null;
/// <summary>Name of User that most recently updated the dashboard. (read-only)</summary>
public string? last_updater_name { get; set; } = null;
/// <summary>Name of User that created the dashboard. (read-only)</summary>
public string? user_name { get; set; } = null;
/// <summary>configuration option that governs how dashboard loading will happen.</summary>
public string? load_configuration { get; set; } = null;
/// <summary>Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match.</summary>
Expand Down Expand Up @@ -3313,6 +3321,8 @@ public class RenderTask : SdkModel
public string? lookml_dashboard_id { get; set; } = null;
/// <summary>Id of query to render (read-only)</summary>
public long? query_id { get; set; } = null;
/// <summary>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)</summary>
public string? dashboard_element_id { get; set; } = null;
/// <summary>Number of seconds elapsed running queries (read-only)</summary>
public double? query_runtime { get; set; } = null;
/// <summary>Number of seconds elapsed rendering data (read-only)</summary>
Expand Down Expand Up @@ -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
{
/// <summary>Description</summary>
Expand Down
4 changes: 2 additions & 2 deletions csharp/sdk/4.0/methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public async Task<SdkResponse<Alert, Exception>> 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
Expand All @@ -125,7 +125,7 @@ public async Task<SdkResponse<Alert, Exception>> update_alert(
/// <param name="alert_id">ID of an alert</param>
public async Task<SdkResponse<Alert, Exception>> update_alert_field(
long alert_id,
WriteAlert body,
AlertPatch body,
ITransportSettings? options = null)
{
return await AuthRequest<Alert, Exception>(HttpMethod.Patch, $"/alerts/{alert_id}", null,body,options);
Expand Down
74 changes: 51 additions & 23 deletions csharp/sdk/4.0/models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -57,18 +57,18 @@ public class Alert : SdkModel
public AlertAppliedDashboardFilter[]? applied_dashboard_filters { get; set; } = null;
/// <summary>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".</summary>
[JsonConverter(typeof(StringEnumConverter))]
public ComparisonType? comparison_type { get; set; }
public ComparisonType comparison_type { get; set; }
/// <summary>Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals</summary>
public string? cron { get; set; } = null;
public string cron { get; set; } = "";
/// <summary>An optional, user-defined title for the alert</summary>
public string? custom_title { get; set; } = null;
/// <summary>ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement)</summary>
public long? dashboard_element_id { get; set; } = null;
/// <summary>An optional description for the alert. This supplements the title</summary>
public string? description { get; set; } = null;
/// <summary>Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]`</summary>
public AlertDestination[]? destinations { get; set; } = null;
public AlertField? field { get; set; }
public AlertDestination[] destinations { get; set; } = null;
public AlertField field { get; set; } = null;
/// <summary>Whether or not the user follows this alert. (read-only)</summary>
public bool? followed { get; set; } = null;
/// <summary>Whether or not the alert is followable (read-only)</summary>
Expand All @@ -77,6 +77,8 @@ public class Alert : SdkModel
public long? id { get; set; } = null;
/// <summary>Whether or not the alert is disabled</summary>
public bool? is_disabled { get; set; } = null;
/// <summary>Reason for disabling alert</summary>
public string? disabled_reason { get; set; } = null;
/// <summary>Whether or not the alert is public</summary>
public bool? is_public { get; set; } = null;
/// <summary>The type of the investigative content Valid values are: "dashboard".</summary>
Expand All @@ -91,22 +93,22 @@ public class Alert : SdkModel
/// <summary>ID of the LookML dashboard element associated with the alert</summary>
public string? lookml_link_id { get; set; } = null;
/// <summary>User id of alert owner</summary>
public long? owner_id { get; set; } = null;
public long owner_id { get; set; }
/// <summary>Alert owner's display name (read-only)</summary>
public string? owner_display_name { get; set; } = null;
/// <summary>Value of the alert threshold</summary>
public double? threshold { get; set; } = null;
public double threshold { get; set; }
public AlertConditionState? time_series_condition_state { get; set; }
}

public class AlertAppliedDashboardFilter : SdkModel
{
/// <summary>Field Title. Refer to `DashboardFilter.title` in [DashboardFilter](#!/types/DashboardFilter). Example `Name`</summary>
public string? filter_title { get; set; } = null;
public string filter_title { get; set; } = "";
/// <summary>Field Name. Refer to `DashboardFilter.dimension` in [DashboardFilter](#!/types/DashboardFilter). Example `distribution_centers.name`</summary>
public string? field_name { get; set; } = null;
public string field_name { get; set; } = "";
/// <summary>Field Value. [Filter Expressions](https://docs.looker.com/reference/filter-expressions). Example `Los Angeles CA`</summary>
public string? filter_value { get; set; } = null;
public string filter_value { get; set; } = "";
/// <summary>Human Readable Filter Description. This may be null or auto-generated. Example `is Los Angeles CA` (read-only)</summary>
public string? filter_description { get; set; } = null;
}
Expand Down Expand Up @@ -135,23 +137,37 @@ public class AlertDestination : SdkModel
public class AlertField : SdkModel
{
/// <summary>Field's title. Usually auto-generated to reflect field name and its filters</summary>
public string? title { get; set; } = null;
public string title { get; set; } = "";
/// <summary>Field's name. Has the format `<view>.<field>` Refer to [docs](https://docs.looker.com/sharing-and-publishing/creating-alerts) for more details</summary>
public string? name { get; set; } = null;
public string name { get; set; } = "";
/// <summary>(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 }] }`</summary>
public AlertFieldFilter[]? filter { get; set; } = null;
}

public class AlertFieldFilter : SdkModel
{
/// <summary>Field Name. Has format `<view>.<field>`</summary>
public string? field_name { get; set; } = null;
public string field_name { get; set; } = "";
/// <summary>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]`</summary>
public object? field_value { get; set; } = null;
public object field_value { get; set; } = null;
/// <summary>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'`</summary>
public string? filter_value { get; set; } = null;
}

public class AlertPatch : SdkModel
{
/// <summary>New owner ID of the alert</summary>
public long? owner_id { get; set; } = null;
/// <summary>Set alert enabled or disabled</summary>
public bool? is_disabled { get; set; } = null;
/// <summary>The reason this alert is disabled</summary>
public string? disabled_reason { get; set; } = null;
/// <summary>Set alert public or private</summary>
public bool? is_public { get; set; } = null;
/// <summary>New threshold value</summary>
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
{
Expand Down Expand Up @@ -1110,6 +1126,14 @@ public class Dashboard : SdkModel
public DateTime? last_accessed_at { get; set; } = null;
/// <summary>Time last viewed in the Looker web UI (read-only)</summary>
public DateTime? last_viewed_at { get; set; } = null;
/// <summary>Time that the Dashboard was most recently updated. (read-only)</summary>
public DateTime? updated_at { get; set; } = null;
/// <summary>Id of User that most recently updated the dashboard. (read-only)</summary>
public long? last_updater_id { get; set; } = null;
/// <summary>Name of User that most recently updated the dashboard. (read-only)</summary>
public string? last_updater_name { get; set; } = null;
/// <summary>Name of User that created the dashboard. (read-only)</summary>
public string? user_name { get; set; } = null;
/// <summary>configuration option that governs how dashboard loading will happen.</summary>
public string? load_configuration { get; set; } = null;
/// <summary>Links this dashboard to a particular LookML dashboard such that calling a **sync** operation on that LookML dashboard will update this dashboard to match.</summary>
Expand Down Expand Up @@ -1452,7 +1476,7 @@ public class DBConnection : SdkModel
/// <summary>Host name/address of server</summary>
public string? host { get; set; } = null;
/// <summary>Port number on server</summary>
public long? port { get; set; } = null;
public string? port { get; set; } = null;
/// <summary>Username for server authentication</summary>
public string? username { get; set; } = null;
/// <summary>(Write-Only) Password for server authentication</summary>
Expand Down Expand Up @@ -3782,6 +3806,8 @@ public class RenderTask : SdkModel
public string? lookml_dashboard_id { get; set; } = null;
/// <summary>Id of query to render (read-only)</summary>
public long? query_id { get; set; } = null;
/// <summary>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)</summary>
public string? dashboard_element_id { get; set; } = null;
/// <summary>Number of seconds elapsed running queries (read-only)</summary>
public double? query_runtime { get; set; } = null;
/// <summary>Number of seconds elapsed rendering data (read-only)</summary>
Expand Down Expand Up @@ -4909,20 +4935,22 @@ public class WriteAlert : SdkModel
public AlertAppliedDashboardFilter[]? applied_dashboard_filters { get; set; } = null;
/// <summary>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".</summary>
[JsonConverter(typeof(StringEnumConverter))]
public ComparisonType? comparison_type { get; set; }
public ComparisonType comparison_type { get; set; }
/// <summary>Vixie-Style crontab specification when to run. At minumum, it has to be longer than 15 minute intervals</summary>
public string? cron { get; set; } = null;
public string cron { get; set; } = "";
/// <summary>An optional, user-defined title for the alert</summary>
public string? custom_title { get; set; } = null;
/// <summary>ID of the dashboard element associated with the alert. Refer to [dashboard_element()](#!/Dashboard/DashboardElement)</summary>
public long? dashboard_element_id { get; set; } = null;
/// <summary>An optional description for the alert. This supplements the title</summary>
public string? description { get; set; } = null;
/// <summary>Array of destinations to send alerts to. Must be the same type of destination. Example `[{ "destination_type": "EMAIL", "email_address": "test@test.com" }]`</summary>
public AlertDestination[]? destinations { get; set; } = null;
public AlertField? field { get; set; }
public AlertDestination[] destinations { get; set; } = null;
public AlertField field { get; set; } = null;
/// <summary>Whether or not the alert is disabled</summary>
public bool? is_disabled { get; set; } = null;
/// <summary>Reason for disabling alert</summary>
public string? disabled_reason { get; set; } = null;
/// <summary>Whether or not the alert is public</summary>
public bool? is_public { get; set; } = null;
/// <summary>The type of the investigative content Valid values are: "dashboard".</summary>
Expand All @@ -4935,9 +4963,9 @@ public class WriteAlert : SdkModel
/// <summary>ID of the LookML dashboard element associated with the alert</summary>
public string? lookml_link_id { get; set; } = null;
/// <summary>User id of alert owner</summary>
public long? owner_id { get; set; } = null;
public long owner_id { get; set; }
/// <summary>Value of the alert threshold</summary>
public double? threshold { get; set; } = null;
public double threshold { get; set; }
public AlertConditionState? time_series_condition_state { get; set; }
}

Expand Down Expand Up @@ -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
{
/// <summary>Description</summary>
Expand Down Expand Up @@ -5334,7 +5362,7 @@ public class WriteDBConnection : SdkModel
/// <summary>Host name/address of server</summary>
public string? host { get; set; } = null;
/// <summary>Port number on server</summary>
public long? port { get; set; } = null;
public string? port { get; set; } = null;
/// <summary>Username for server authentication</summary>
public string? username { get; set; } = null;
/// <summary>(Write-Only) Password for server authentication</summary>
Expand Down
Loading

0 comments on commit fa98888

Please sign in to comment.