Module: Google::Cloud::Dialogflow::V2::SessionEntityTypes::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb

Overview

Path helper methods for the SessionEntityTypes API.

Instance Method Summary collapse

Instance Method Details

#session_entity_type_path(project: , session: , entity_type: ) ⇒ ::String #session_entity_type_path(project: , environment: , user: , session: , entity_type: ) ⇒ ::String #session_entity_type_path(project: , location: , session: , entity_type: ) ⇒ ::String #session_entity_type_path(project: , location: , environment: , user: , session: , entity_type: ) ⇒ ::String

Create a fully-qualified SessionEntityType resource string.

Overloads:

  • #session_entity_type_path(project: , session: , entity_type: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}

    Parameters:

    • project (String) (defaults to: )
    • session (String) (defaults to: )
    • entity_type (String) (defaults to: )
  • #session_entity_type_path(project: , environment: , user: , session: , entity_type: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}

    Parameters:

    • project (String) (defaults to: )
    • environment (String) (defaults to: )
    • user (String) (defaults to: )
    • session (String) (defaults to: )
    • entity_type (String) (defaults to: )
  • #session_entity_type_path(project: , location: , session: , entity_type: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • session (String) (defaults to: )
    • entity_type (String) (defaults to: )
  • #session_entity_type_path(project: , location: , environment: , user: , session: , entity_type: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • environment (String) (defaults to: )
    • user (String) (defaults to: )
    • session (String) (defaults to: )
    • entity_type (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb', line 150

def session_entity_type_path **args
  resources = {
    "entity_type:project:session" => (proc do |project:, session:, entity_type:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}"
    end),
    "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}"
    end),
    "entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}"
    end),
    "entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
      raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end

#session_path(project: , session: ) ⇒ ::String #session_path(project: , environment: , user: , session: ) ⇒ ::String #session_path(project: , location: , session: ) ⇒ ::String #session_path(project: , location: , environment: , user: , session: ) ⇒ ::String

Create a fully-qualified Session resource string.

Overloads:

  • #session_path(project: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/agent/sessions/{session}

    Parameters:

    • project (String) (defaults to: )
    • session (String) (defaults to: )
  • #session_path(project: , environment: , user: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}

    Parameters:

    • project (String) (defaults to: )
    • environment (String) (defaults to: )
    • user (String) (defaults to: )
    • session (String) (defaults to: )
  • #session_path(project: , location: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agent/sessions/{session}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • session (String) (defaults to: )
  • #session_path(project: , location: , environment: , user: , session: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • environment (String) (defaults to: )
    • user (String) (defaults to: )
    • session (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb', line 69

def session_path **args
  resources = {
    "project:session" => (proc do |project:, session:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

      "projects/#{project}/agent/sessions/#{session}"
    end),
    "environment:project:session:user" => (proc do |project:, environment:, user:, session:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"

      "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
    end),
    "location:project:session" => (proc do |project:, location:, session:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/sessions/#{session}"
    end),
    "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
      raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end