title: Dialogflow v2 Beta 1 Update Intent with Python
body: <p>I am lost.
  I have a currently existing Intent in my project, and I am trying to update ALL fields programmatically because that is what my project requires.</p>
  
  <p>I read <a href="https://dialogflow-python-client-v2.readthedocs.io/en/latest/gapic/v2beta1/api.html" rel="nofollow noreferrer">this</a> documentation and checked <a href="https://github.com/googleapis/dialogflow-python-client-v2/blob/master/dialogflow_v2beta1/gapic/intents_client.py" rel="nofollow noreferrer">this source file</a> on GitHub, and I think the reason I am getting an error is because I don't understand this part of the source:</p>
  
  <blockquote>
    <p>Args:
                intent (Union[dict, ~google.cloud.dialogflow_v2beta1.types.Intent]): Required. The intent
    to update.
                    Format: <code>projects/&lt;Project ID&gt;/agent/intents/&lt;Intent ID&gt;</code>.
                    If a dict is provided, it must be of the same form as the protobuf
                    message :class:<code>~google.cloud.dialogflow_v2beta1.types.Intent</code></p>
  </blockquote>
  
  <p><strong>(Line 484 for reference)</strong></p>
  
  <p>The platform works great I just don't know what I am missing here..</p>
  
  <p><strong>My code</strong></p>
  
  <pre><code>from constants import *
  from google.oauth2 import service_account
  import dialogflow_v2beta1
  cred = service_account.Credentials.from_service_account_file(AUTH_JSON)
  client = dialogflow_v2beta1.IntentsClient(credentials=cred)
  params = dialogflow_v2beta1.types.Intent.Parameter(name='test', display_name='test', value='test', is_list=True)
  t = dialogflow_v2beta1.types.Intent.Message.Text(text='TEST TEXT')
  m = dialogflow_v2beta1.types.Intent.Message(text=t)
  p = dialogflow_v2beta1.types.Intent.TrainingPhrase.Part(text='test',entity_type='@test_type', alias='test_alias', user_defined=True)
  t = dialogflow_v2beta1.types.Intent.TrainingPhrase(name='test',type=2, parts=[p])
  modified_intent = dialogflow_v2beta1.types.Intent(
      display_name='test',       
      messages=[m],
      webhook_state=1,
      is_fallback=False,
      ml_disabled=False,
      input_context_names=PROJECT_DIR+'agent/sessions/-/contexts/' + 'TEST_CONTEXT',
      events='TESTING EVENT',
      training_phrases=[t],
      action='TESTING ACTION',
      reset_contexts=False,
      parameters=[params]
      ) 
  name = client.intent_path(PROJECT_NAME, '7b8f2105-53d4-4724-8d4c-0170b8db7028')
  intent = client.get_intent(name)
  client.update_intent(intent=modified_intent, language_code=LANGUAGE_CODE, intent_view=0)
  </code></pre>
  
  <p><strong>Full error message</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "/anaconda/envs/data/lib/python3.6/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
      return callable_(*args, **kwargs)
    File "/anaconda/envs/data/lib/python3.6/site-packages/grpc/_channel.py", line 550, in __call__
      return _end_unary_response_blocking(state, call, False, None)
    File "/anaconda/envs/data/lib/python3.6/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking
      raise _Rendezvous(state, None, None, deadline)
  grpc._channel._Rendezvous: &lt;_Rendezvous of RPC that terminated with:
          status = StatusCode.INVALID_ARGUMENT
          details = "Resource name '' does not match 'projects/*/agent/intents/*'."
          debug_error_string = "{"created":"@1552461629.958860000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1036,"grpc_message":"Resource name '' does not match 'projects/*/agent/intents/*'.","grpc_status":3}"
  &gt;
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "test.py", line 26, in &lt;module&gt;
      client.update_intent(intent=modified_intent, language_code=LANGUAGE_CODE, intent_view=0)
    File "/anaconda/envs/data/lib/python3.6/site-packages/dialogflow_v2beta1/gapic/intents_client.py", line 535, in update_intent
      request, retry=retry, timeout=timeout, metadata=metadata)
    File "/anaconda/envs/data/lib/python3.6/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
      return wrapped_func(*args, **kwargs)
    File "/anaconda/envs/data/lib/python3.6/site-packages/google/api_core/retry.py", line 270, in retry_wrapped_func
      on_error=on_error,
    File "/anaconda/envs/data/lib/python3.6/site-packages/google/api_core/retry.py", line 179, in retry_target
      return target()
    File "/anaconda/envs/data/lib/python3.6/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
      return func(*args, **kwargs)
    File "/anaconda/envs/data/lib/python3.6/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
      six.raise_from(exceptions.from_grpc_error(exc), exc)
    File "&lt;string&gt;", line 3, in raise_from
  google.api_core.exceptions.InvalidArgument: 400 Resource name '' does not match 'projects/*/agent/intents/*'.
  </code></pre>