Skip to content

Commit 304d0d0

Browse files
feat: Looker 21.20 bindings (#899)
* 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
1 parent c092c93 commit 304d0d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5842
-3603
lines changed

.github/workflows/codegen-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
${{ github.workspace }}/.github/scripts/wait_for_looker.sh
8585
8686
- name: Run unit tests
87-
run: yarn jest "packages/sdk-codegen(-utils|-scripts)/src" --reporters=default --reporters=jest-junit
87+
run: yarn jest "packages/sdk-codegen(|-utils|-scripts)/src" --reporters=default --reporters=jest-junit
8888

8989
- name: Delete looker.ini mock
9090
run: rm looker.ini

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,28 @@ yarn run
190190

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

193+
After generation, the generated code might not conform with the code standards.
194+
Changes cannot be commited until they pass the lint tests.
195+
This can be checked with the following:
196+
```sh
197+
yarn lint
198+
```
199+
200+
For a faster run, only the modified files can be checked with any of these
201+
commands:
202+
```sh
203+
yarn lint-changed
204+
yarn lint -q
205+
yarn lint --quick
206+
```
207+
208+
Fixes can automagically be applied with one of the following:
209+
```sh
210+
yarn lint-changed-fix
211+
yarn lint -q -f
212+
yarn lint --quick --fix
213+
```
214+
193215
## SDK Examples
194216

195217
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.

csharp/rtl/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public struct Constants
6161

6262
public const string DefaultApiVersion = "4.0";
6363
public const string AgentPrefix = "CS-SDK";
64-
public const string LookerVersion = "21.18";
64+
public const string LookerVersion = "21.20";
6565

6666
public const string Bearer = "Bearer";
6767
public const string LookerAppiId = "x-looker-appid";

csharp/sdk/3.1/methods.cs

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// SOFTWARE.
2222
///
2323

24-
/// 376 API methods
24+
/// 378 API methods
2525

2626
#nullable enable
2727
using System;
@@ -2447,6 +2447,52 @@ public async Task<SdkResponse<Datagroup, Exception>> update_datagroup(
24472447

24482448
#endregion Datagroup: Manage Datagroups
24492449

2450+
#region DerivedTable: View Derived Table graphs
2451+
2452+
/// ### Discover information about derived tables
2453+
///
2454+
/// GET /derived_table/graph/model/{model} -> DependencyGraph
2455+
///
2456+
/// <returns><c>DependencyGraph</c> Derived Table (application/json)</returns>
2457+
///
2458+
/// <param name="model">The name of the Lookml model.</param>
2459+
/// <param name="format">The format of the graph. Valid values are [dot]. Default is `dot`</param>
2460+
/// <param name="color">Color denoting the build status of the graph. Grey = not built, green = built, yellow = building, red = error.</param>
2461+
public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_for_model(
2462+
string model,
2463+
string? format = null,
2464+
string? color = null,
2465+
ITransportSettings? options = null)
2466+
{
2467+
model = SdkUtils.EncodeParam(model);
2468+
return await AuthRequest<DependencyGraph, Exception>(HttpMethod.Get, $"/derived_table/graph/model/{model}", new Values {
2469+
{ "format", format },
2470+
{ "color", color }},null,options);
2471+
}
2472+
2473+
/// ### Get the subgraph representing this derived table and its dependencies.
2474+
///
2475+
/// GET /derived_table/graph/view/{view} -> DependencyGraph
2476+
///
2477+
/// <returns><c>DependencyGraph</c> Graph of the derived table component, represented in the DOT language. (application/json)</returns>
2478+
///
2479+
/// <param name="view">The derived table's view name.</param>
2480+
/// <param name="models">The models where this derived table is defined.</param>
2481+
/// <param name="workspace">The model directory to look in, either `dev` or `production`.</param>
2482+
public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_for_view(
2483+
string view,
2484+
string? models = null,
2485+
string? workspace = null,
2486+
ITransportSettings? options = null)
2487+
{
2488+
view = SdkUtils.EncodeParam(view);
2489+
return await AuthRequest<DependencyGraph, Exception>(HttpMethod.Get, $"/derived_table/graph/view/{view}", new Values {
2490+
{ "models", models },
2491+
{ "workspace", workspace }},null,options);
2492+
}
2493+
2494+
#endregion DerivedTable: View Derived Table graphs
2495+
24502496
#region Folder: Manage Folders
24512497

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

38353881
#region LookmlModel: Manage LookML Models
38363882

3837-
/// ### Discover information about derived tables
3838-
///
3839-
/// GET /derived_table/graph/model/{model} -> DependencyGraph
3840-
///
3841-
/// <returns><c>DependencyGraph</c> Derived Table (application/json)</returns>
3842-
///
3843-
/// <param name="model">The name of the Lookml model.</param>
3844-
/// <param name="format">The format of the graph. Valid values are [dot]. Default is `dot`</param>
3845-
/// <param name="color">Color denoting the build status of the graph. Grey = not built, green = built, yellow = building, red = error.</param>
3846-
public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_for_model(
3847-
string model,
3848-
string? format = null,
3849-
string? color = null,
3850-
ITransportSettings? options = null)
3851-
{
3852-
model = SdkUtils.EncodeParam(model);
3853-
return await AuthRequest<DependencyGraph, Exception>(HttpMethod.Get, $"/derived_table/graph/model/{model}", new Values {
3854-
{ "format", format },
3855-
{ "color", color }},null,options);
3856-
}
3857-
38583883
/// ### Get information about all lookml models.
38593884
///
38603885
/// GET /lookml_models -> LookmlModel[]

csharp/sdk/3.1/models.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ public class Dashboard : SdkModel
745745
/// <summary>The preferred route for viewing this dashboard (ie: dashboards or dashboards-next)</summary>
746746
public string? preferred_viewer { get; set; } = null;
747747
public SpaceBase? space { get; set; }
748-
/// <summary>Enables alerts to keep in sync with dashboard filter changes - only available in Enhanced Alerts (beta)</summary>
748+
/// <summary>Enables alerts to keep in sync with dashboard filter changes</summary>
749749
public bool? alert_sync_with_dashboard_filter_enabled { get; set; } = null;
750750
/// <summary>Background color</summary>
751751
public string? background_color { get; set; } = null;
@@ -4532,7 +4532,7 @@ public class WriteDashboard : SdkModel
45324532
/// 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
45334533
/// </summary>
45344534
public WriteSpaceBase? space { get; set; }
4535-
/// <summary>Enables alerts to keep in sync with dashboard filter changes - only available in Enhanced Alerts (beta)</summary>
4535+
/// <summary>Enables alerts to keep in sync with dashboard filter changes</summary>
45364536
public bool? alert_sync_with_dashboard_filter_enabled { get; set; } = null;
45374537
/// <summary>Background color</summary>
45384538
public string? background_color { get; set; } = null;

0 commit comments

Comments
 (0)