Skip to content

Commit

Permalink
feat: Looker 21.20 bindings (#899)
Browse files Browse the repository at this point in the history
* Updated packages for Looker 21.20

* fix: codgegen for python had a parameter called 'models' but also a variable called 'models'. The names interfered. Aliased the models namespace to mdls in methods.py.

* docs: added note about linting to README

* fix: alias models namespace to mdls so no conflict with parameter models

* fix: look.id is now a string but tests were checking for integer

* fix: fixed minor changes to specs

* fix: add sdk-codegen/src tests into the mix
  • Loading branch information
drstrangelooker authored Nov 10, 2021
1 parent c092c93 commit 304d0d0
Show file tree
Hide file tree
Showing 47 changed files with 5,842 additions and 3,603 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codegen-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
${{ github.workspace }}/.github/scripts/wait_for_looker.sh
- name: Run unit tests
run: yarn jest "packages/sdk-codegen(-utils|-scripts)/src" --reporters=default --reporters=jest-junit
run: yarn jest "packages/sdk-codegen(|-utils|-scripts)/src" --reporters=default --reporters=jest-junit

- name: Delete looker.ini mock
run: rm looker.ini
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,28 @@ yarn run

to see the list of all scripts that can be run by the code generator.

After generation, the generated code might not conform with the code standards.
Changes cannot be commited until they pass the lint tests.
This can be checked with the following:
```sh
yarn lint
```

For a faster run, only the modified files can be checked with any of these
commands:
```sh
yarn lint-changed
yarn lint -q
yarn lint --quick
```

Fixes can automagically be applied with one of the following:
```sh
yarn lint-changed-fix
yarn lint -q -f
yarn lint --quick --fix
```

## SDK Examples

The [examples directory](/examples) contains code snippets and projects written using the Looker language SDKs. You may find useful code in that repository. and are also welcome to contribute additional examples.
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.18";
public const string LookerVersion = "21.20";

public const string Bearer = "Bearer";
public const string LookerAppiId = "x-looker-appid";
Expand Down
69 changes: 47 additions & 22 deletions csharp/sdk/3.1/methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// SOFTWARE.
///

/// 376 API methods
/// 378 API methods

#nullable enable
using System;
Expand Down Expand Up @@ -2447,6 +2447,52 @@ public async Task<SdkResponse<Datagroup, Exception>> update_datagroup(

#endregion Datagroup: Manage Datagroups

#region DerivedTable: View Derived Table graphs

/// ### Discover information about derived tables
///
/// GET /derived_table/graph/model/{model} -> DependencyGraph
///
/// <returns><c>DependencyGraph</c> Derived Table (application/json)</returns>
///
/// <param name="model">The name of the Lookml model.</param>
/// <param name="format">The format of the graph. Valid values are [dot]. Default is `dot`</param>
/// <param name="color">Color denoting the build status of the graph. Grey = not built, green = built, yellow = building, red = error.</param>
public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_for_model(
string model,
string? format = null,
string? color = null,
ITransportSettings? options = null)
{
model = SdkUtils.EncodeParam(model);
return await AuthRequest<DependencyGraph, Exception>(HttpMethod.Get, $"/derived_table/graph/model/{model}", new Values {
{ "format", format },
{ "color", color }},null,options);
}

/// ### Get the subgraph representing this derived table and its dependencies.
///
/// GET /derived_table/graph/view/{view} -> DependencyGraph
///
/// <returns><c>DependencyGraph</c> Graph of the derived table component, represented in the DOT language. (application/json)</returns>
///
/// <param name="view">The derived table's view name.</param>
/// <param name="models">The models where this derived table is defined.</param>
/// <param name="workspace">The model directory to look in, either `dev` or `production`.</param>
public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_for_view(
string view,
string? models = null,
string? workspace = null,
ITransportSettings? options = null)
{
view = SdkUtils.EncodeParam(view);
return await AuthRequest<DependencyGraph, Exception>(HttpMethod.Get, $"/derived_table/graph/view/{view}", new Values {
{ "models", models },
{ "workspace", workspace }},null,options);
}

#endregion DerivedTable: View Derived Table graphs

#region Folder: Manage Folders

/// Search for folders by creator id, parent id, name, etc
Expand Down Expand Up @@ -3834,27 +3880,6 @@ public async Task<SdkResponse<TSuccess, Exception>> run_look<TSuccess>(

#region LookmlModel: Manage LookML Models

/// ### Discover information about derived tables
///
/// GET /derived_table/graph/model/{model} -> DependencyGraph
///
/// <returns><c>DependencyGraph</c> Derived Table (application/json)</returns>
///
/// <param name="model">The name of the Lookml model.</param>
/// <param name="format">The format of the graph. Valid values are [dot]. Default is `dot`</param>
/// <param name="color">Color denoting the build status of the graph. Grey = not built, green = built, yellow = building, red = error.</param>
public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_for_model(
string model,
string? format = null,
string? color = null,
ITransportSettings? options = null)
{
model = SdkUtils.EncodeParam(model);
return await AuthRequest<DependencyGraph, Exception>(HttpMethod.Get, $"/derived_table/graph/model/{model}", new Values {
{ "format", format },
{ "color", color }},null,options);
}

/// ### Get information about all lookml models.
///
/// GET /lookml_models -> LookmlModel[]
Expand Down
4 changes: 2 additions & 2 deletions csharp/sdk/3.1/models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public class Dashboard : SdkModel
/// <summary>The preferred route for viewing this dashboard (ie: dashboards or dashboards-next)</summary>
public string? preferred_viewer { get; set; } = null;
public SpaceBase? space { get; set; }
/// <summary>Enables alerts to keep in sync with dashboard filter changes - only available in Enhanced Alerts (beta)</summary>
/// <summary>Enables alerts to keep in sync with dashboard filter changes</summary>
public bool? alert_sync_with_dashboard_filter_enabled { get; set; } = null;
/// <summary>Background color</summary>
public string? background_color { get; set; } = null;
Expand Down Expand Up @@ -4532,7 +4532,7 @@ public class WriteDashboard : SdkModel
/// id, content_metadata_id, created_at, creator_id, child_count, external_id, is_embed, is_embed_shared_root, is_embed_users_root, is_personal, is_personal_descendant, is_shared_root, is_users_root, can
/// </summary>
public WriteSpaceBase? space { get; set; }
/// <summary>Enables alerts to keep in sync with dashboard filter changes - only available in Enhanced Alerts (beta)</summary>
/// <summary>Enables alerts to keep in sync with dashboard filter changes</summary>
public bool? alert_sync_with_dashboard_filter_enabled { get; set; } = null;
/// <summary>Background color</summary>
public string? background_color { get; set; } = null;
Expand Down
Loading

0 comments on commit 304d0d0

Please sign in to comment.