Skip to content

Commit 3ba5420

Browse files
feat: SDK for Looker 22_2 (#966)
1 parent da01692 commit 3ba5420

35 files changed

+4614
-56
lines changed

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 = "22.0";
64+
public const string LookerVersion = "22.2";
6565

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

csharp/sdk/3.1/methods.cs

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// SOFTWARE.
2222
///
2323

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

2626
#nullable enable
2727
using System;
@@ -1091,6 +1091,21 @@ public async Task<SdkResponse<Locale[], Exception>> all_locales(
10911091
return await AuthRequest<Locale[], Exception>(HttpMethod.Get, "/locales", null,null,options);
10921092
}
10931093

1094+
/// ### Configure SMTP Settings
1095+
/// This API allows users to configure the SMTP settings on the Looker instance.
1096+
/// This API is only supported in the OEM jar. Additionally, only admin users are authorised to call this API.
1097+
///
1098+
/// POST /smtp_settings -> void
1099+
///
1100+
/// <returns><c>void</c> Successfully updated SMTP settings ()</returns>
1101+
///
1102+
public async Task<SdkResponse<string, Exception>> set_smtp_settings(
1103+
SmtpSettings body,
1104+
ITransportSettings? options = null)
1105+
{
1106+
return await AuthRequest<string, Exception>(HttpMethod.Post, "/smtp_settings", null,body,options);
1107+
}
1108+
10941109
/// ### Get a list of timezones that Looker supports (e.g. useful for scheduling tasks).
10951110
///
10961111
/// GET /timezones -> Timezone[]
@@ -2491,6 +2506,69 @@ public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_
24912506
{ "workspace", workspace }},null,options);
24922507
}
24932508

2509+
/// Enqueue materialization for a PDT with the given model name and view name
2510+
///
2511+
/// GET /derived_table/{model_name}/{view_name}/start -> MaterializePDT
2512+
///
2513+
/// <returns><c>MaterializePDT</c> Derived Table (application/json)</returns>
2514+
///
2515+
/// <param name="model_name">The model of the PDT to start building.</param>
2516+
/// <param name="view_name">The view name of the PDT to start building.</param>
2517+
/// <param name="force_rebuild">Force rebuild of required dependent PDTs, even if they are already materialized.</param>
2518+
/// <param name="force_full_incremental">Force involved incremental PDTs to fully re-materialize.</param>
2519+
/// <param name="workspace">Workspace in which to materialize selected PDT ('dev' or default 'production').</param>
2520+
/// <param name="source">The source of this request.</param>
2521+
public async Task<SdkResponse<MaterializePDT, Exception>> start_pdt_build(
2522+
string model_name,
2523+
string view_name,
2524+
string? force_rebuild = null,
2525+
string? force_full_incremental = null,
2526+
string? workspace = null,
2527+
string? source = null,
2528+
ITransportSettings? options = null)
2529+
{
2530+
model_name = SdkUtils.EncodeParam(model_name);
2531+
view_name = SdkUtils.EncodeParam(view_name);
2532+
return await AuthRequest<MaterializePDT, Exception>(HttpMethod.Get, $"/derived_table/{model_name}/{view_name}/start", new Values {
2533+
{ "force_rebuild", force_rebuild },
2534+
{ "force_full_incremental", force_full_incremental },
2535+
{ "workspace", workspace },
2536+
{ "source", source }},null,options);
2537+
}
2538+
2539+
/// Check status of PDT materialization
2540+
///
2541+
/// GET /derived_table/{materialization_id}/status -> MaterializePDT
2542+
///
2543+
/// <returns><c>MaterializePDT</c> Derived Table (application/json)</returns>
2544+
///
2545+
/// <param name="materialization_id">The materialization id to check status for.</param>
2546+
public async Task<SdkResponse<MaterializePDT, Exception>> check_pdt_build(
2547+
string materialization_id,
2548+
ITransportSettings? options = null)
2549+
{
2550+
materialization_id = SdkUtils.EncodeParam(materialization_id);
2551+
return await AuthRequest<MaterializePDT, Exception>(HttpMethod.Get, $"/derived_table/{materialization_id}/status", null,null,options);
2552+
}
2553+
2554+
/// Stop a PDT materialization
2555+
///
2556+
/// GET /derived_table/{materialization_id}/stop -> MaterializePDT
2557+
///
2558+
/// <returns><c>MaterializePDT</c> Derived Table (application/json)</returns>
2559+
///
2560+
/// <param name="materialization_id">The materialization id to stop.</param>
2561+
/// <param name="source">The source of this request.</param>
2562+
public async Task<SdkResponse<MaterializePDT, Exception>> stop_pdt_build(
2563+
string materialization_id,
2564+
string? source = null,
2565+
ITransportSettings? options = null)
2566+
{
2567+
materialization_id = SdkUtils.EncodeParam(materialization_id);
2568+
return await AuthRequest<MaterializePDT, Exception>(HttpMethod.Get, $"/derived_table/{materialization_id}/stop", new Values {
2569+
{ "source", source }},null,options);
2570+
}
2571+
24942572
#endregion DerivedTable: View Derived Table graphs
24952573

24962574
#region Folder: Manage Folders

csharp/sdk/3.1/models.cs

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

24-
/// 255 API models: 188 Spec, 0 Request, 51 Write, 16 Enum
24+
/// 258 API models: 190 Spec, 0 Request, 51 Write, 17 Enum
2525

2626
#nullable enable
2727
using System;
@@ -1018,7 +1018,9 @@ public class DashboardLookml : SdkModel
10181018
{
10191019
/// <summary>Id of Dashboard (read-only)</summary>
10201020
public string? dashboard_id { get; set; } = null;
1021-
/// <summary>lookml of UDD (read-only)</summary>
1021+
/// <summary>(Write-Only) Id of the folder</summary>
1022+
public string? folder_id { get; set; } = null;
1023+
/// <summary>lookml of UDD</summary>
10221024
public string? lookml { get; set; } = null;
10231025
}
10241026

@@ -2777,6 +2779,14 @@ public class Manifest : SdkModel
27772779
public LocalizationSettings? localization_settings { get; set; }
27782780
}
27792781

2782+
public class MaterializePDT : SdkModel
2783+
{
2784+
/// <summary>The ID of the enqueued materialization task (read-only)</summary>
2785+
public string? materialization_id { get; set; } = null;
2786+
/// <summary>Detailed response in text format (read-only)</summary>
2787+
public string? resp_text { get; set; } = null;
2788+
}
2789+
27802790
public class MergeFields : SdkModel
27812791
{
27822792
/// <summary>Field name to map onto in the merged results</summary>
@@ -3776,6 +3786,25 @@ public class SessionConfig : SdkModel
37763786
public bool? track_session_location { get; set; } = null;
37773787
}
37783788

3789+
public class SmtpSettings : SdkModel
3790+
{
3791+
/// <summary>SMTP Server url</summary>
3792+
public string? address { get; set; } = null;
3793+
/// <summary>From e-mail address</summary>
3794+
public string? from { get; set; } = null;
3795+
/// <summary>User name</summary>
3796+
public string? user_name { get; set; } = null;
3797+
/// <summary>Password</summary>
3798+
public string? password { get; set; } = null;
3799+
/// <summary>SMTP Server's port</summary>
3800+
public long? port { get; set; } = null;
3801+
/// <summary>Is TLS encryption enabled?</summary>
3802+
public bool? enable_starttls_auto { get; set; } = null;
3803+
/// <summary>TLS version selected Valid values are: "TLSv1_1", "SSLv23", "TLSv1_2".</summary>
3804+
[JsonConverter(typeof(StringEnumConverter))]
3805+
public SslVersion? ssl_version { get; set; }
3806+
}
3807+
37793808
public class Snippet : SdkModel
37803809
{
37813810
/// <summary>Name of the snippet (read-only)</summary>
@@ -3908,6 +3937,17 @@ public class SqlQueryCreate : SdkModel
39083937
public StringDictionary<object>? vis_config { get; set; } = null;
39093938
}
39103939

3940+
/// TLS version selected Valid values are: "TLSv1_1", "SSLv23", "TLSv1_2". (Enum defined in SmtpSettings)
3941+
public enum SslVersion
3942+
{
3943+
[EnumMember(Value = "TLSv1_1")]
3944+
TLSv1_1,
3945+
[EnumMember(Value = "SSLv23")]
3946+
SSLv23,
3947+
[EnumMember(Value = "TLSv1_2")]
3948+
TLSv1_2
3949+
}
3950+
39113951
/// A list of action types the integration supports. Valid values are: "cell", "query", "dashboard". (Enum defined in Integration)
39123952
public enum SupportedActionTypes
39133953
{

csharp/sdk/4.0/methods.cs

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// SOFTWARE.
2222
///
2323

24-
/// 437 API methods
24+
/// 443 API methods
2525

2626
#nullable enable
2727
using System;
@@ -1872,6 +1872,20 @@ public async Task<SdkResponse<DigestEmailSend, Exception>> create_digest_email_s
18721872
return await AuthRequest<DigestEmailSend, Exception>(HttpMethod.Post, "/digest_email_send", null,null,options);
18731873
}
18741874

1875+
/// ### Get Egress IP Addresses
1876+
///
1877+
/// Returns the list of public egress IP Addresses for a hosted customer's instance
1878+
///
1879+
/// GET /public_egress_ip_addresses -> EgressIpAddresses
1880+
///
1881+
/// <returns><c>EgressIpAddresses</c> Public Egress IP Addresses (application/json)</returns>
1882+
///
1883+
public async Task<SdkResponse<EgressIpAddresses, Exception>> public_egress_ip_addresses(
1884+
ITransportSettings? options = null)
1885+
{
1886+
return await AuthRequest<EgressIpAddresses, Exception>(HttpMethod.Get, "/public_egress_ip_addresses", null,null,options);
1887+
}
1888+
18751889
/// ### Set the menu item name and content for internal help resources
18761890
///
18771891
/// GET /internal_help_resources_content -> InternalHelpResourcesContent
@@ -2038,6 +2052,21 @@ public async Task<SdkResponse<Setting, Exception>> set_setting(
20382052
{ "fields", fields }},body,options);
20392053
}
20402054

2055+
/// ### Configure SMTP Settings
2056+
/// This API allows users to configure the SMTP settings on the Looker instance.
2057+
/// This API is only supported in the OEM jar. Additionally, only admin users are authorised to call this API.
2058+
///
2059+
/// POST /smtp_settings -> void
2060+
///
2061+
/// <returns><c>void</c> Successfully updated SMTP settings ()</returns>
2062+
///
2063+
public async Task<SdkResponse<string, Exception>> set_smtp_settings(
2064+
SmtpSettings body,
2065+
ITransportSettings? options = null)
2066+
{
2067+
return await AuthRequest<string, Exception>(HttpMethod.Post, "/smtp_settings", null,body,options);
2068+
}
2069+
20412070
/// ### Get current SMTP status.
20422071
///
20432072
/// GET /smtp_status -> SmtpStatus
@@ -3248,6 +3277,28 @@ public async Task<SdkResponse<Dashboard, Exception>> move_dashboard(
32483277
{ "folder_id", folder_id }},null,options);
32493278
}
32503279

3280+
/// ### Creates a new dashboard object based on LookML Dashboard YAML, and returns the details of the newly created dashboard.
3281+
///
3282+
/// This is equivalent to creating a LookML Dashboard and converting to a User-defined dashboard.
3283+
///
3284+
/// LookML must contain valid LookML YAML code. It's recommended to use the LookML format returned
3285+
/// from [dashboard_lookml()](#!/Dashboard/dashboard_lookml) as the input LookML (newlines replaced with
3286+
/// ).
3287+
///
3288+
/// Note that the created dashboard is not linked to any LookML Dashboard,
3289+
/// i.e. [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard) will not update dashboards created by this method.
3290+
///
3291+
/// POST /dashboards/from_lookml -> DashboardLookml
3292+
///
3293+
/// <returns><c>DashboardLookml</c> DashboardLookML (application/json)</returns>
3294+
///
3295+
public async Task<SdkResponse<DashboardLookml, Exception>> create_dashboard_from_lookml(
3296+
WriteDashboardLookml body,
3297+
ITransportSettings? options = null)
3298+
{
3299+
return await AuthRequest<DashboardLookml, Exception>(HttpMethod.Post, "/dashboards/from_lookml", null,body,options);
3300+
}
3301+
32513302
/// ### Copy an existing dashboard
32523303
///
32533304
/// Creates a copy of an existing dashboard, in a specified folder, and returns the copied dashboard.
@@ -3764,6 +3815,69 @@ public async Task<SdkResponse<DependencyGraph, Exception>> graph_derived_tables_
37643815
{ "workspace", workspace }},null,options);
37653816
}
37663817

3818+
/// Enqueue materialization for a PDT with the given model name and view name
3819+
///
3820+
/// GET /derived_table/{model_name}/{view_name}/start -> MaterializePDT
3821+
///
3822+
/// <returns><c>MaterializePDT</c> Derived Table (application/json)</returns>
3823+
///
3824+
/// <param name="model_name">The model of the PDT to start building.</param>
3825+
/// <param name="view_name">The view name of the PDT to start building.</param>
3826+
/// <param name="force_rebuild">Force rebuild of required dependent PDTs, even if they are already materialized.</param>
3827+
/// <param name="force_full_incremental">Force involved incremental PDTs to fully re-materialize.</param>
3828+
/// <param name="workspace">Workspace in which to materialize selected PDT ('dev' or default 'production').</param>
3829+
/// <param name="source">The source of this request.</param>
3830+
public async Task<SdkResponse<MaterializePDT, Exception>> start_pdt_build(
3831+
string model_name,
3832+
string view_name,
3833+
string? force_rebuild = null,
3834+
string? force_full_incremental = null,
3835+
string? workspace = null,
3836+
string? source = null,
3837+
ITransportSettings? options = null)
3838+
{
3839+
model_name = SdkUtils.EncodeParam(model_name);
3840+
view_name = SdkUtils.EncodeParam(view_name);
3841+
return await AuthRequest<MaterializePDT, Exception>(HttpMethod.Get, $"/derived_table/{model_name}/{view_name}/start", new Values {
3842+
{ "force_rebuild", force_rebuild },
3843+
{ "force_full_incremental", force_full_incremental },
3844+
{ "workspace", workspace },
3845+
{ "source", source }},null,options);
3846+
}
3847+
3848+
/// Check status of PDT materialization
3849+
///
3850+
/// GET /derived_table/{materialization_id}/status -> MaterializePDT
3851+
///
3852+
/// <returns><c>MaterializePDT</c> Derived Table (application/json)</returns>
3853+
///
3854+
/// <param name="materialization_id">The materialization id to check status for.</param>
3855+
public async Task<SdkResponse<MaterializePDT, Exception>> check_pdt_build(
3856+
string materialization_id,
3857+
ITransportSettings? options = null)
3858+
{
3859+
materialization_id = SdkUtils.EncodeParam(materialization_id);
3860+
return await AuthRequest<MaterializePDT, Exception>(HttpMethod.Get, $"/derived_table/{materialization_id}/status", null,null,options);
3861+
}
3862+
3863+
/// Stop a PDT materialization
3864+
///
3865+
/// GET /derived_table/{materialization_id}/stop -> MaterializePDT
3866+
///
3867+
/// <returns><c>MaterializePDT</c> Derived Table (application/json)</returns>
3868+
///
3869+
/// <param name="materialization_id">The materialization id to stop.</param>
3870+
/// <param name="source">The source of this request.</param>
3871+
public async Task<SdkResponse<MaterializePDT, Exception>> stop_pdt_build(
3872+
string materialization_id,
3873+
string? source = null,
3874+
ITransportSettings? options = null)
3875+
{
3876+
materialization_id = SdkUtils.EncodeParam(materialization_id);
3877+
return await AuthRequest<MaterializePDT, Exception>(HttpMethod.Get, $"/derived_table/{materialization_id}/stop", new Values {
3878+
{ "source", source }},null,options);
3879+
}
3880+
37673881
#endregion DerivedTable: View Derived Table graphs
37683882

37693883
#region Folder: Manage Folders

0 commit comments

Comments
 (0)