Sha256: eeb76424f697541953d27ccdfc6bcb3c55e1f472343b2e14910cd674034ba8a5

Contents?: true

Size: 1.39 KB

Versions: 30

Compression:

Stored size: 1.39 KB

Contents

#  Copyright 2023. Couchbase, Inc.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

# frozen_string_literal: true

require "couchbase/management/collection_manager"

module Couchbase
  module Protostellar
    module ResponseConverter
      module Admin
        class Collection
          def self.to_scope_spec_array(resp)
            resp.scopes.map do |s|
              Couchbase::Management::ScopeSpec.new do |scope_spec|
                scope_spec.name = s.name
                scope_spec.collections = s.collections.map do |c|
                  Couchbase::Management::CollectionSpec.new do |coll_spec|
                    coll_spec.name = c.name
                    coll_spec.scope_name = s.name
                    coll_spec.max_expiry = c.max_expiry_secs if c.has_max_expiry_secs?
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
couchbase-3.5.5 lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.5-arm64-darwin lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.5-x86_64-darwin lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.5-x86_64-linux lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.5-x86_64-linux-musl lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.4 lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.4-arm64-darwin lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.4-x86_64-darwin lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.4-x86_64-linux lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.4-x86_64-linux-musl lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.3-x86_64-linux-musl lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.3 lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.3-arm64-darwin lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.3-x86_64-darwin lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.3-x86_64-linux lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.2 lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.2-x86_64-linux lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.2-x86_64-darwin lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.2-x86_64-linux-musl lib/couchbase/protostellar/response_converter/admin/collection.rb
couchbase-3.5.1 lib/couchbase/protostellar/response_converter/admin/collection.rb