GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — EnvironmentSessionName defaults to draft · Issue #3305 · googleapis/google-cloud-java

EnvironmentSessionName defaults to draft #3305

New issue
Copy link
New issue
Copy link
Closed
Closed
EnvironmentSessionName defaults to draft#3305
Copy link
Assignees
andreamlin
Labels
type: questionRequest for information or clarification. Not an issue.

Description

@naderz
naderz
opened on May 23, 2018
Issue body actions

What is the current default value to EnvironmentSessionName? How can i default to Draft?

It doesnt seem to be possible at the moment to fallback to draft and i cant find any documentation around that.

Activity

  1. andreamlin commented on May 23, 2018

    @andreamlin
    andreamlin
    on May 23, 2018
    Contributor
    More actions

    Hello,

    Is this regarding dialogflow.v2beta1 class EnvironmentSessionName?

    What do you mean by "Draft"?

  2. andreamlin
    added
    type: questionRequest for information or clarification. Not an issue.
    on May 23, 2018
  3. naderz commented on May 23, 2018

    @naderz
    naderz
    on May 23, 2018 via email
    Author
    More actions
    Yes it is and Draft is the draft State as in not pointing to any environment but just the draft version.
    On Wed, 23 May 2018 at 12:11 PM, Andrea Lin ***@***.***> wrote: Hello, Is this regarding dialogflow.v2beta1 class EnvironmentSessionName <https://github.com/GoogleCloudPlatform/google-cloud-java/blob/ae3638af5b764f1f63b523ac0a21093d396bdf10/google-api-grpc/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/EnvironmentSessionName.java> ? What do you mean by "Draft"? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#3305 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABVkSE7T8rhQl8FadWRpJe0XGT0sJCuEks5t1KklgaJpZM4UJklz> .
    -- Regards, *Nader Ayyad*
  4. andreamlin commented on May 23, 2018

    @andreamlin
    andreamlin
    on May 23, 2018
    Contributor
    More actions

    Hello Nader,

    One way to instantiate an EnvironmentSessionName is through a static constructor

    EnvironmentSessionName.of("project", "environment", "user", "session")
    

    Can you explain what a Draft object is? What are you trying to do with your draft object?

  5. naderz commented on May 23, 2018

    @naderz
    naderz
    on May 23, 2018 via email
    Author
    More actions
    I know how to initialize an environment and point to one but what if i dont want to point to any environment? Just the currently being editted agent( which in dialogflow is being called draft thus im using the term draft) Do i still need to use just SessionName or i can use EnvironmentSessionName and not specifiy the environment? My current solution is if else and either use one of those but id rather use EnvironmentSessionName for both cases anyways? Is it now clear enough?
    On Thu, 24 May 2018 at 7:02 AM, Andrea Lin ***@***.***> wrote: Hello Nader, One way to instantiate an EnvironmentSessionName is through a static constructor EnvironmentSessionName.of("project", "environment", "user", "session") Can you explain what a Draft object is? What are you trying to do with your draft object? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#3305 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABVkSBnLkhNYVOe6yPeMkamKJJH02bL5ks5t1bJGgaJpZM4UJklz> .
    -- Regards, *Nader Ayyad*
  6. andreamlin commented on May 24, 2018

    @andreamlin
    andreamlin
    on May 24, 2018
    Contributor
    More actions

    It depends on what dialogflow RPC method you are calling. The EnvironmentSessionName will format strings as an endpoint path `projects/{project}/environments/{environment}/users/{user}/sessions/{session}", which points to a specific resource.

    What method, and on what resource, are you calling?

  7. naderz commented on May 24, 2018

    @naderz
    naderz
    on May 24, 2018
    Author
    More actions

    I am calling the EnvironmentSessionName method.

    ​let me try to clarify what I'm trying to do more, I have the following method:

        private fun getSessionName(sessionId: String): ResourceName {
            return if (DRAFT.equalsTo(dialogFlowConfig.environment)) {
                SessionName.newBuilder()
                        .setProject(dialogFlowConfig.projectId)
                        .setSession(sessionId).build()
            } else {
                EnvironmentSessionName.newBuilder()
                        .setEnvironment(dialogFlowConfig.environment)
                        .setProject(dialogFlowConfig.projectId)
                        .setUser(sessionId)
                        .setSession(sessionId).build()
            }
        }
    

    screen shot 2018-05-25 at 9 39 36 am

    As the screenshot depicts i have 2 environments and a draft.

    The way we used to connect to the draft prior to introducing the environment feature was via SessionName.NewBuilder()... and now after introducing environments feature we have to use EnvironmentSessionName... what im wondering is can we actually just point to draft in some way via EnvironmentSessionName?

    The reason im asking is after reading through the sdk code i found the comment in context.proto

    // Required. The unique identifier of the context. Format:
    // projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>,
    // or
    // projects/<Project ID>/agent/environments/<Environment ID>/users/<User // ID>/sessions/<Session ID>/contexts/<Context ID>. Note: Environments and
    // users are under construction and will be available soon. The Context ID is
    // always converted to lowercase. If is not specified, we
    // assume default 'draft' environment. If is not specified, we
    // assume default '-' user.

    I hope now i made my question clearer. let me know if you need any further clarification.

  8. andreamlin commented on Jun 5, 2018

    @andreamlin
    andreamlin
    on Jun 5, 2018
    Contributor
    More actions

    @naderz

    Ah thanks for clarifying your question! Yes, not specifying the environment will default to the Draft environment. Alternatively, if you wish to be explicit, you can set the environment to be the string "draft", which does the same thing and points to a draft environment.

    I've confirmed this with our internal code, and this is documented in both the proto you mentioned and in the comments for methods in the ContextClient.java class.

    Hope that helps!

  9. andreamlin
    closed this as completedon Jun 5, 2018
  10. JustinBeckwith
    assigned
    andreamlin
    on Feb 1, 2021
  11. suztomo
    added 2 commits that reference this issue on Mar 9, 2026

    deps: update dependency com.google.oauth-client:google-oauth-client-j…

    d05e554

    chore(main): release 2.40.3 (#3325)

    4b9613d
  12. chingor13
    added 3 commits that reference this issue on Mar 24, 2026

    build(deps): update dependency org.apache.maven.plugins:maven-project…

    6730ef6

    chore: skip clirr 7012 exceptions with grpc admin package #3222 (#3305)

    daf7572

    chore(main): release 2.58.1-SNAPSHOT (#3305)

    4cdbe45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @andreamlin
    andreamlin

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.