microsoft_kiota_abstractions 0.13.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 278d9b47f5ee5386af0e047ea6d1b54ecfe7cd370591604ed6ac2ea8980b1acf
4
- data.tar.gz: 319859f7f00b664ae9e2b6134d7430015f109fee9c8d0adb410924c2cdb23012
3
+ metadata.gz: bcf8f29ec3c3ecdf52066bbfa9d80671b9a4d74a1e68bc122e91f7ac87129073
4
+ data.tar.gz: ebb9e05a3412445b8538dfda142548d887a2f7b85fbbae7a6e1389170f79c2a0
5
5
  SHA512:
6
- metadata.gz: '08d217eceb07235bb8a396d265e94b8fb927e09f40b583a1ffe458e381fe0c814926311ef3c1b85c31748efac851dba308c3404eccb1ba83216c18c3fca1876b'
7
- data.tar.gz: 4297b2d100735a4fd2a9dfd5fdc44b8e1265fbfa4e3eb2e0d1c7d599a602b8fe9b93522adafa8605e8e717a171ac9e1dd2525a5a3912e6a9898f6cc5129d863e
6
+ metadata.gz: ba3fabf3438a9b52839da552477982da40fc755dfccc309783bfc81dea71c2047a9672b7803ac49d900e3620f1edbbcb203e36e954e129ebc371ed1aa1440400
7
+ data.tar.gz: cd0c37ffe8598939668cf336fc51ebe3c733adfafafd76246a66300f854ead904fa2fe09364e5df9514389fea05784358151823f6f695bf702c8bc15f12c2ca0
data/.github/CODEOWNERS CHANGED
@@ -1 +1 @@
1
- * @andrueastman @baywet @darrelmiller @zengin @MichaelMainer @ddyett @peombwa @nikithauc @ramsessanchez @calebkiage @Ndiritu @rkodev @gavinbarron
1
+ * @andrueastman @baywet @zengin @MichaelMainer @calebkiage @rkodev
@@ -0,0 +1,101 @@
1
+ id:
2
+ name: GitOps.PullRequestIssueManagement
3
+ description: GitOps.PullRequestIssueManagement primitive
4
+ owner:
5
+ resource: repository
6
+ disabled: false
7
+ where:
8
+ configuration:
9
+ resourceManagementConfiguration:
10
+ scheduledSearches:
11
+ - description:
12
+ frequencies:
13
+ - hourly:
14
+ hour: 6
15
+ filters:
16
+ - isIssue
17
+ - isOpen
18
+ - hasLabel:
19
+ label: 'Needs: Author Feedback'
20
+ - hasLabel:
21
+ label: 'Status: No Recent Activity'
22
+ - noActivitySince:
23
+ days: 3
24
+ actions:
25
+ - closeIssue
26
+ - description:
27
+ frequencies:
28
+ - hourly:
29
+ hour: 6
30
+ filters:
31
+ - isIssue
32
+ - isOpen
33
+ - hasLabel:
34
+ label: 'Needs: Author Feedback'
35
+ - noActivitySince:
36
+ days: 4
37
+ - isNotLabeledWith:
38
+ label: 'Status: No Recent Activity'
39
+ actions:
40
+ - addLabel:
41
+ label: 'Status: No Recent Activity'
42
+ - addReply:
43
+ reply: This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
44
+ - description:
45
+ frequencies:
46
+ - hourly:
47
+ hour: 6
48
+ filters:
49
+ - isIssue
50
+ - isOpen
51
+ - hasLabel:
52
+ label: 'Resolution: Duplicate'
53
+ - noActivitySince:
54
+ days: 1
55
+ actions:
56
+ - addReply:
57
+ reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
58
+ - closeIssue
59
+ eventResponderTasks:
60
+ - if:
61
+ - payloadType: Issue_Comment
62
+ - isAction:
63
+ action: Created
64
+ - isActivitySender:
65
+ issueAuthor: True
66
+ - hasLabel:
67
+ label: 'Needs: Author Feedback'
68
+ - isOpen
69
+ then:
70
+ - addLabel:
71
+ label: 'Needs: Attention :wave:'
72
+ - removeLabel:
73
+ label: 'Needs: Author Feedback'
74
+ description:
75
+ - if:
76
+ - payloadType: Issues
77
+ - not:
78
+ isAction:
79
+ action: Closed
80
+ - hasLabel:
81
+ label: 'Status: No Recent Activity'
82
+ then:
83
+ - removeLabel:
84
+ label: 'Status: No Recent Activity'
85
+ description:
86
+ - if:
87
+ - payloadType: Issue_Comment
88
+ - hasLabel:
89
+ label: 'Status: No Recent Activity'
90
+ then:
91
+ - removeLabel:
92
+ label: 'Status: No Recent Activity'
93
+ description:
94
+ - if:
95
+ - payloadType: Pull_Request
96
+ then:
97
+ - inPrLabel:
98
+ label: WIP
99
+ description:
100
+ onFailure:
101
+ onSuccess:
@@ -0,0 +1,32 @@
1
+ name: Auto-merge dependabot updates
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [ main ]
6
+
7
+ permissions:
8
+ pull-requests: write
9
+ contents: write
10
+
11
+ jobs:
12
+
13
+ dependabot-merge:
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ if: ${{ github.actor == 'dependabot[bot]' }}
18
+
19
+ steps:
20
+ - name: Dependabot metadata
21
+ id: metadata
22
+ uses: dependabot/fetch-metadata@v1.6.0
23
+ with:
24
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
25
+
26
+ - name: Enable auto-merge for Dependabot PRs
27
+ # Only if version bump is not a major version change
28
+ if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
29
+ run: gh pr merge --auto --merge "$PR_URL"
30
+ env:
31
+ PR_URL: ${{github.event.pull_request.html_url}}
32
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
@@ -40,7 +40,7 @@ jobs:
40
40
 
41
41
  steps:
42
42
  - name: Checkout repository
43
- uses: actions/checkout@v3
43
+ uses: actions/checkout@v4
44
44
 
45
45
  # Initializes the CodeQL tools for scanning.
46
46
  - name: Initialize CodeQL
@@ -10,7 +10,7 @@ jobs:
10
10
  steps:
11
11
  - name: Generate token
12
12
  id: generate_token
13
- uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c
13
+ uses: tibdex/github-app-token@0d49dd721133f900ebd5e0dff2810704e8defbc6
14
14
  with:
15
15
  app_id: ${{ secrets.GRAPHBOT_APP_ID }}
16
16
  private_key: ${{ secrets.GRAPHBOT_APP_PEM }}
@@ -10,7 +10,7 @@ jobs:
10
10
  Git_Release:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
  - name: Github Release
15
15
  uses: anton-yurchenko/git-release@v5.0
16
16
  env:
@@ -25,10 +25,10 @@ jobs:
25
25
  name: production_feeds
26
26
  runs-on: ubuntu-latest
27
27
  steps:
28
- - uses: actions/checkout@v3
28
+ - uses: actions/checkout@v4
29
29
  - uses: ruby/setup-ruby@v1
30
30
  with:
31
- ruby-version: '3.1'
31
+ ruby-version: '3.2'
32
32
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
33
  bundler: 'latest'
34
34
  cache-version: 1
@@ -12,20 +12,20 @@ jobs:
12
12
  fail-fast: false
13
13
  matrix:
14
14
  os: [ubuntu-latest, macos-latest]
15
- ruby-version: ['2.7', '3.0', '3.1', head, jruby, jruby-head, truffleruby, truffleruby-head]
15
+ ruby-version: ['3.0', '3.1', '3.2', head, jruby, jruby-head, truffleruby, truffleruby-head]
16
16
  runs-on: ${{ matrix.os }}
17
17
  steps:
18
- - uses: actions/checkout@v3
18
+ - uses: actions/checkout@v4
19
19
  - uses: ruby/setup-ruby@v1
20
20
  with:
21
21
  ruby-version: ${{ matrix.ruby-version }}
22
22
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
23
23
  bundler: 'latest'
24
- cache-version: 1
24
+ cache-version: 2
25
25
  - name: Run tests
26
26
  run: bundle exec rake
27
27
  - name: Upload artifacts for ruby version 3 and ubuntu
28
- if: ${{ matrix.os == 'ubuntu-latest' && matrix.ruby-version == '3.1'}}
28
+ if: ${{ matrix.os == 'ubuntu-latest' && matrix.ruby-version == '3.2'}}
29
29
  uses: actions/upload-artifact@v3
30
30
  with:
31
31
  name: drop
data/CHANGELOG.md CHANGED
@@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ### Changed
13
13
 
14
+ ## [0.14.0] - 2023-03-14
15
+
16
+ ### Added
17
+
18
+ - Added a base request builder and request configuration class to reduce the amount of generated code.
19
+
20
+ ### Changed
21
+
22
+ - Bumped minimum required ruby version to 3.0.
23
+
14
24
  ## [0.13.0] - 2023-01-10
15
25
 
16
26
  ### Added
@@ -0,0 +1,36 @@
1
+ module MicrosoftKiotaAbstractions
2
+ ##
3
+ # Base class for request builders. Performs basic validation and defines common properties.
4
+ class BaseRequestBuilder
5
+ ##
6
+ # Path parameters for the request
7
+ @path_parameters
8
+ ##
9
+ # The request adapter to use to execute the requests.
10
+ @request_adapter
11
+ ##
12
+ # Url template to use to build the URL for the current request builder
13
+ @url_template
14
+ ##
15
+ ## Instantiates a new BaseRequestBuilder and sets the default values.
16
+ ## @param path_parameters Path parameters for the request
17
+ ## @param request_adapter The request adapter to use to execute the requests.
18
+ ## @param url_template Url template to use to build the URL for the current request builder
19
+ ## @return a void
20
+ ##
21
+ def initialize(path_parameters, request_adapter, url_template)
22
+ raise StandardError, 'request_adapter cannot be null' if request_adapter.nil?
23
+ raise StandardError, 'url_template cannot be null' if url_template.nil? || url_template.empty?
24
+ @request_adapter = request_adapter
25
+ unless path_parameters.nil? then
26
+ if path_parameters.is_a? Hash then
27
+ @path_parameters = path_parameters.clone
28
+ elsif path_parameters.is_a? String then
29
+ @path_parameters = { "request-raw-url" => path_parameters }
30
+ end
31
+ end
32
+ @path_parameters = Hash.new if path_parameters.nil?
33
+ @url_template = url_template
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,22 @@
1
+ require_relative 'request_headers'
2
+
3
+ module MicrosoftKiotaAbstractions
4
+ ##
5
+ # Configuration for the request such as headers, query parameters, and middleware options.
6
+ class RequestConfiguration
7
+ ##
8
+ # Request headers
9
+ attr_accessor :headers
10
+ ##
11
+ # Request options
12
+ attr_accessor :options
13
+ ##
14
+ # Request query parameters
15
+ attr_accessor :query_parameters
16
+
17
+ def initialize
18
+ @headers = RequestHeaders.new
19
+ @options = Array.new
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  require 'uri'
2
- require 'addressable/template'
2
+ require 'stduritemplate'
3
3
  require_relative 'http_method'
4
4
  require_relative 'request_headers'
5
5
 
@@ -34,8 +34,7 @@ module MicrosoftKiotaAbstractions
34
34
  self.uri = self.path_parameters[@@raw_url_key]
35
35
  return @uri
36
36
  else
37
- template = Addressable::Template.new(@url_template)
38
- return URI(template.expand(self.path_parameters.merge(self.query_parameters)).to_s)
37
+ return URI(StdUriTemplate.expand(@url_template, self.path_parameters.merge(self.query_parameters)))
39
38
  end
40
39
  end
41
40
  end
@@ -105,7 +104,7 @@ module MicrosoftKiotaAbstractions
105
104
  end
106
105
 
107
106
  def add_headers_from_raw_object(h)
108
- h.select{|x,y| @headers.add(x.to_s, y)} unless !h
107
+ h.get_all.select{|x,y| @headers.add(x.to_s, y)} unless !h
109
108
  end
110
109
 
111
110
  def set_query_string_parameters_from_raw_object(q)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MicrosoftKiotaAbstractions
4
- VERSION = "0.13.0"
4
+ VERSION = "0.14.1"
5
5
  end
@@ -5,8 +5,10 @@ require_relative "microsoft_kiota_abstractions/authentication/base_bearer_token_
5
5
  require_relative "microsoft_kiota_abstractions/authentication/anonymous_authentication_provider"
6
6
  require_relative "microsoft_kiota_abstractions/api_error"
7
7
  require_relative "microsoft_kiota_abstractions/http_method"
8
+ require_relative "microsoft_kiota_abstractions/base_request_builder"
8
9
  require_relative "microsoft_kiota_abstractions/api_client_builder"
9
10
  require_relative "microsoft_kiota_abstractions/request_adapter"
11
+ require_relative "microsoft_kiota_abstractions/request_configuration"
10
12
  require_relative "microsoft_kiota_abstractions/request_option"
11
13
  require_relative "microsoft_kiota_abstractions/request_headers"
12
14
  require_relative "microsoft_kiota_abstractions/request_information"
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.name = 'microsoft_kiota_abstractions'
7
7
  spec.version = MicrosoftKiotaAbstractions::VERSION
8
8
  spec.authors = 'Microsoft Corporation'
9
- spec.email = 'graphsdkpub@microsoft.com'
9
+ spec.email = 'graphsdkpub+ruby@microsoft.com'
10
10
  spec.description = 'Microsoft Kiota Abstractions - Ruby abstractions for building library agnostic http client'
11
11
  spec.summary = 'The Kiota abstractions are language specific libraries defining the basic constructs Kiota projects need once an SDK has been generated from an OpenAPI definition.'
12
12
  spec.homepage = 'https://microsoft.github.io/kiota/'
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  'source_code_uri' => 'https://github.com/microsoft/kiota-abstractions-ruby',
19
19
  'github_repo' => 'ssh://github.com/microsoft/kiota-abstractions-ruby'
20
20
  }
21
- spec.required_ruby_version = '>= 2.7.0'
21
+ spec.required_ruby_version = '>= 3.0.0'
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.bindir = 'bin'
29
29
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ['lib']
31
- spec.add_runtime_dependency 'addressable', '~> 2.7', '>= 2.7.0'
31
+ spec.add_runtime_dependency 'stduritemplate', '~> 0.0.39'
32
32
  spec.add_runtime_dependency 'iso8601', '~> 0.13.0'
33
33
  spec.add_development_dependency 'rake', '~> 13.0'
34
34
  spec.add_development_dependency 'rspec', '~> 3.0'
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: microsoft_kiota_abstractions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-10 00:00:00.000000000 Z
11
+ date: 2023-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: addressable
14
+ name: stduritemplate
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.7'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 2.7.0
19
+ version: 0.0.39
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '2.7'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 2.7.0
26
+ version: 0.0.39
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: iso8601
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -88,13 +82,15 @@ dependencies:
88
82
  version: '0'
89
83
  description: Microsoft Kiota Abstractions - Ruby abstractions for building library
90
84
  agnostic http client
91
- email: graphsdkpub@microsoft.com
85
+ email: graphsdkpub+ruby@microsoft.com
92
86
  executables: []
93
87
  extensions: []
94
88
  extra_rdoc_files: []
95
89
  files:
96
90
  - ".github/CODEOWNERS"
97
91
  - ".github/dependabot.yml"
92
+ - ".github/policies/resourceManagement.yml"
93
+ - ".github/workflows/auto-merge-dependabot.yml"
98
94
  - ".github/workflows/code-ql.yml"
99
95
  - ".github/workflows/conflicting-pr-label.yml"
100
96
  - ".github/workflows/projectsbot.yml"
@@ -117,8 +113,10 @@ files:
117
113
  - lib/microsoft_kiota_abstractions/authentication/anonymous_authentication_provider.rb
118
114
  - lib/microsoft_kiota_abstractions/authentication/authentication_provider.rb
119
115
  - lib/microsoft_kiota_abstractions/authentication/base_bearer_token_authentication_provider.rb
116
+ - lib/microsoft_kiota_abstractions/base_request_builder.rb
120
117
  - lib/microsoft_kiota_abstractions/http_method.rb
121
118
  - lib/microsoft_kiota_abstractions/request_adapter.rb
119
+ - lib/microsoft_kiota_abstractions/request_configuration.rb
122
120
  - lib/microsoft_kiota_abstractions/request_headers.rb
123
121
  - lib/microsoft_kiota_abstractions/request_information.rb
124
122
  - lib/microsoft_kiota_abstractions/request_option.rb
@@ -150,14 +148,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
148
  requirements:
151
149
  - - ">="
152
150
  - !ruby/object:Gem::Version
153
- version: 2.7.0
151
+ version: 3.0.0
154
152
  required_rubygems_version: !ruby/object:Gem::Requirement
155
153
  requirements:
156
154
  - - ">="
157
155
  - !ruby/object:Gem::Version
158
156
  version: '0'
159
157
  requirements: []
160
- rubygems_version: 3.3.26
158
+ rubygems_version: 3.4.10
161
159
  signing_key:
162
160
  specification_version: 4
163
161
  summary: The Kiota abstractions are language specific libraries defining the basic