looker-sdk 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/scripts/wait_for_looker.sh +35 -0
- data/.github/workflows/release-metrics.yml +44 -0
- data/.github/workflows/release.yml +47 -0
- data/.github/workflows/ruby-ci.yml +137 -0
- data/.gitignore +3 -1
- data/CHANGELOG.md +36 -0
- data/CODE_OF_CONDUCT.md +73 -26
- data/CONTRIBUTING.md +29 -0
- data/Gemfile.lock +85 -0
- data/LICENSE.md +14 -26
- data/Octokit_LICENSE.md +22 -0
- data/{readme.md → README.md} +3 -2
- data/Rakefile +5 -1
- data/examples/add_delete_users.rb +1 -1
- data/examples/change_credentials_email_address_for_users.rb +1 -1
- data/examples/convert_look_to_lookless_tile.rb +2 -2
- data/examples/create_credentials_email_for_users.rb +1 -1
- data/examples/delete_all_user_sessions.rb +1 -1
- data/examples/delete_credentials_google_for_users.rb +1 -1
- data/examples/errors.rb +47 -0
- data/examples/generate_password_reset_tokens_for_users.rb +1 -1
- data/examples/ldap_roles_test.rb +1 -1
- data/examples/me.rb +1 -1
- data/examples/refresh_user_notification_addresses.rb +1 -1
- data/examples/roles_and_users_with_permission.rb +1 -1
- data/examples/sdk_setup.rb +3 -3
- data/examples/streaming_downloads.rb +1 -1
- data/examples/users_with_credentials_email.rb +1 -1
- data/examples/users_with_credentials_embed.rb +1 -1
- data/examples/users_with_credentials_google.rb +1 -1
- data/examples/users_with_credentials_google_without_credentials_email.rb +1 -1
- data/lib/looker-sdk/authentication.rb +1 -1
- data/lib/looker-sdk/client/dynamic.rb +1 -1
- data/lib/looker-sdk/client.rb +1 -1
- data/lib/looker-sdk/configurable.rb +1 -1
- data/lib/looker-sdk/default.rb +1 -1
- data/lib/looker-sdk/error.rb +41 -2
- data/lib/looker-sdk/rate_limit.rb +1 -1
- data/lib/looker-sdk/response/raise_error.rb +1 -1
- data/lib/looker-sdk/sawyer_patch.rb +1 -1
- data/lib/looker-sdk/version.rb +2 -2
- data/lib/looker-sdk.rb +18 -15
- data/looker-sdk.gemspec +6 -4
- data/shell/Gemfile +1 -1
- data/shell/shell.rb +3 -3
- data/shell.nix +38 -0
- data/test/helper.rb +31 -5
- data/test/looker/test_client.rb +36 -14
- data/test/looker/test_dynamic_client.rb +1 -1
- data/test/looker/test_dynamic_client_agent.rb +1 -1
- metadata +47 -11
- data/.travis.yml +0 -15
data/test/helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
############################################################################################
|
2
2
|
# The MIT License (MIT)
|
3
3
|
#
|
4
|
-
# Copyright (c)
|
4
|
+
# Copyright (c) 2022 Looker Data Sciences, Inc.
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -52,15 +52,41 @@ def fix_netrc_permissions(path)
|
|
52
52
|
File.chmod(0600, path) unless s.mode.to_s(8)[3..5] == "0600"
|
53
53
|
end
|
54
54
|
|
55
|
-
|
55
|
+
begin
|
56
|
+
fix_netrc_permissions(File.join(fixture_path, '.netrc'))
|
57
|
+
rescue => e
|
58
|
+
puts e
|
59
|
+
end
|
56
60
|
|
57
61
|
def setup_sdk
|
58
62
|
LookerSDK.reset!
|
63
|
+
|
64
|
+
base_url = ENV['LOOKERSDK_BASE_URL'] || 'https://localhost:19999'
|
65
|
+
verify_ssl = case ENV['LOOKERSDK_VERIFY_SSL']
|
66
|
+
when /false/i
|
67
|
+
false
|
68
|
+
when /f/i
|
69
|
+
false
|
70
|
+
when '0'
|
71
|
+
false
|
72
|
+
else
|
73
|
+
true
|
74
|
+
end
|
75
|
+
api_version = ENV['LOOKERSDK_API_VERSION'] || '4.0'
|
76
|
+
client_id = ENV['LOOKERSDK_CLIENT_ID']
|
77
|
+
client_secret = ENV['LOOKERSDK_CLIENT_SECRET']
|
78
|
+
|
59
79
|
LookerSDK.configure do |c|
|
60
80
|
c.lazy_swagger = true
|
61
|
-
c.connection_options = {:ssl => {:verify => false}}
|
62
|
-
|
63
|
-
|
81
|
+
c.connection_options = {:ssl => {:verify => false}} unless verify_ssl
|
82
|
+
if (client_id && client_secret) then
|
83
|
+
c.client_id = client_id
|
84
|
+
c.client_secret = client_secret
|
85
|
+
c.api_endpoint = "#{base_url}/api/#{api_version}"
|
86
|
+
else
|
87
|
+
c.netrc = true
|
88
|
+
c.netrc_file = File.join(fixture_path, '.netrc')
|
89
|
+
end
|
64
90
|
end
|
65
91
|
end
|
66
92
|
|
data/test/looker/test_client.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
############################################################################################
|
2
2
|
# The MIT License (MIT)
|
3
3
|
#
|
4
|
-
# Copyright (c)
|
4
|
+
# Copyright (c) 2022 Looker Data Sciences, Inc.
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -30,16 +30,42 @@ describe LookerSDK::Client do
|
|
30
30
|
setup_sdk
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
base_url = ENV['LOOKERSDK_BASE_URL'] || 'https://localhost:19999'
|
34
|
+
verify_ssl = case ENV['LOOKERSDK_VERIFY_SSL']
|
35
|
+
when /false/i
|
36
|
+
false
|
37
|
+
when /f/i
|
38
|
+
false
|
39
|
+
when '0'
|
40
|
+
false
|
41
|
+
else
|
42
|
+
true
|
43
|
+
end
|
44
|
+
api_version = ENV['LOOKERSDK_API_VERSION'] || '4.0'
|
45
|
+
client_id = ENV['LOOKERSDK_CLIENT_ID']
|
46
|
+
client_secret = ENV['LOOKERSDK_CLIENT_SECRET']
|
47
|
+
|
48
|
+
opts = {}
|
49
|
+
if (client_id && client_secret) then
|
50
|
+
opts.merge!({
|
51
|
+
:client_id => client_id,
|
52
|
+
:client_secret => client_secret,
|
53
|
+
:api_endpoint => "#{base_url}/api/#{api_version}",
|
54
|
+
})
|
55
|
+
opts[:connection_options] = {:ssl => {:verify => false}} unless verify_ssl
|
56
|
+
else
|
57
|
+
opts.merge!({
|
58
|
+
:netrc => true,
|
59
|
+
:netrc_file => File.join(fixture_path, '.netrc'),
|
60
|
+
:connection_options => {:ssl => {:verify => false}},
|
61
|
+
})
|
62
|
+
|
63
|
+
end
|
34
64
|
|
65
|
+
describe "lazy load swagger" do
|
35
66
|
it "lazy loads swagger" do
|
36
67
|
LookerSDK.reset!
|
37
|
-
client = LookerSDK::Client.new(
|
38
|
-
:lazy_swagger => true,
|
39
|
-
:netrc => true,
|
40
|
-
:netrc_file => File.join(fixture_path, '.netrc'),
|
41
|
-
:connection_options => {:ssl => {:verify => false}},
|
42
|
-
)
|
68
|
+
client = LookerSDK::Client.new(opts.merge({:lazy_swagger => true}))
|
43
69
|
assert_nil client.swagger
|
44
70
|
client.me()
|
45
71
|
assert client.swagger
|
@@ -47,12 +73,7 @@ describe LookerSDK::Client do
|
|
47
73
|
|
48
74
|
it "loads swagger initially" do
|
49
75
|
LookerSDK.reset!
|
50
|
-
client = LookerSDK::Client.new(
|
51
|
-
:lazy_swagger => false,
|
52
|
-
:netrc => true,
|
53
|
-
:netrc_file => File.join(fixture_path, '.netrc'),
|
54
|
-
:connection_options => {:ssl => {:verify => false}},
|
55
|
-
)
|
76
|
+
client = LookerSDK::Client.new(opts.merge({:lazy_swagger => false}))
|
56
77
|
assert client.swagger
|
57
78
|
end
|
58
79
|
end
|
@@ -135,6 +156,7 @@ describe LookerSDK::Client do
|
|
135
156
|
|
136
157
|
describe "with .netrc" do
|
137
158
|
it "can read .netrc files" do
|
159
|
+
skip unless File.exist?(File.join(fixture_path, '.netrc'))
|
138
160
|
LookerSDK.reset!
|
139
161
|
client = LookerSDK::Client.new(
|
140
162
|
:lazy_swagger => true,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
############################################################################################
|
2
2
|
# The MIT License (MIT)
|
3
3
|
#
|
4
|
-
# Copyright (c)
|
4
|
+
# Copyright (c) 2022 Looker Data Sciences, Inc.
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -1,7 +1,7 @@
|
|
1
1
|
############################################################################################
|
2
2
|
# The MIT License (MIT)
|
3
3
|
#
|
4
|
-
# Copyright (c)
|
4
|
+
# Copyright (c) 2022 Looker Data Sciences, Inc.
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the "Software"), to deal
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: looker-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Looker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sawyer
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '1.2'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '3.0'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,24 +43,60 @@ dependencies:
|
|
43
43
|
version: '1.2'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '3.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: ci_reporter_minitest
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '1.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: faraday
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.10'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.10'
|
47
75
|
description: Use this SDK to access the Looker API. The Looker API provides functions
|
48
76
|
to perform administrative tasks such as provisioning users, configuring database
|
49
77
|
connections, and so on. It also enables you to leverage the Looker data analytics
|
50
78
|
engine to fetch data or render visualizations defined in your Looker data models.
|
51
79
|
For more information, see https://looker.com.
|
52
|
-
email:
|
80
|
+
email: drstrangelove@google.com
|
53
81
|
executables: []
|
54
82
|
extensions: []
|
55
83
|
extra_rdoc_files: []
|
56
84
|
files:
|
85
|
+
- ".github/scripts/wait_for_looker.sh"
|
86
|
+
- ".github/workflows/release-metrics.yml"
|
87
|
+
- ".github/workflows/release.yml"
|
88
|
+
- ".github/workflows/ruby-ci.yml"
|
57
89
|
- ".gitignore"
|
58
90
|
- ".ruby-gemset"
|
59
|
-
-
|
91
|
+
- CHANGELOG.md
|
60
92
|
- CODE_OF_CONDUCT.md
|
93
|
+
- CONTRIBUTING.md
|
61
94
|
- Gemfile
|
95
|
+
- Gemfile.lock
|
62
96
|
- LICENSE.md
|
63
97
|
- Makefile
|
98
|
+
- Octokit_LICENSE.md
|
99
|
+
- README.md
|
64
100
|
- Rakefile
|
65
101
|
- authentication.md
|
66
102
|
- examples/.netrc
|
@@ -70,6 +106,7 @@ files:
|
|
70
106
|
- examples/create_credentials_email_for_users.rb
|
71
107
|
- examples/delete_all_user_sessions.rb
|
72
108
|
- examples/delete_credentials_google_for_users.rb
|
109
|
+
- examples/errors.rb
|
73
110
|
- examples/generate_password_reset_tokens_for_users.rb
|
74
111
|
- examples/ldap_roles_test.rb
|
75
112
|
- examples/me.rb
|
@@ -93,7 +130,7 @@ files:
|
|
93
130
|
- lib/looker-sdk/sawyer_patch.rb
|
94
131
|
- lib/looker-sdk/version.rb
|
95
132
|
- looker-sdk.gemspec
|
96
|
-
-
|
133
|
+
- shell.nix
|
97
134
|
- shell/.gitignore
|
98
135
|
- shell/.netrc
|
99
136
|
- shell/Gemfile
|
@@ -107,7 +144,7 @@ files:
|
|
107
144
|
- test/looker/test_dynamic_client.rb
|
108
145
|
- test/looker/test_dynamic_client_agent.rb
|
109
146
|
- test/looker/user.json
|
110
|
-
homepage: https://github.com/looker/looker-sdk-ruby
|
147
|
+
homepage: https://github.com/looker-open-source/looker-sdk-ruby
|
111
148
|
licenses:
|
112
149
|
- MIT
|
113
150
|
metadata: {}
|
@@ -119,7 +156,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
156
|
requirements:
|
120
157
|
- - ">="
|
121
158
|
- !ruby/object:Gem::Version
|
122
|
-
version: '2.
|
159
|
+
version: '2.7'
|
123
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
161
|
requirements:
|
125
162
|
- - ">="
|
@@ -127,8 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
164
|
version: '0'
|
128
165
|
requirements:
|
129
166
|
- Looker version 4.0 or later
|
130
|
-
|
131
|
-
rubygems_version: 2.7.6.2
|
167
|
+
rubygems_version: 3.1.6
|
132
168
|
signing_key:
|
133
169
|
specification_version: 4
|
134
170
|
summary: Looker Ruby SDK
|