Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 981 for Optional (0.15 sec)

  1. tests/test_security_oauth2_password_bearer_optional.py

    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import OAuth2PasswordBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token", auto_error=False)
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        if token is None:
            return {"msg": "Create an account first"}
        return {"token": token}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  2. tests/test_security_oauth2_password_bearer_optional_description.py

    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import OAuth2PasswordBearer
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(
        tokenUrl="/token",
        description="OAuth2PasswordBearer security scheme",
        auto_error=False,
    )
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        if token is None:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  3. tests/test_security_api_key_cookie_optional.py

    from typing import Optional
    
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyCookie
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    api_key = APIKeyCookie(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(api_key)):
        if oauth_header is None:
            return None
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  4. tests/test_security_api_key_query_optional.py

    from typing import Optional
    
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyQuery
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    api_key = APIKeyQuery(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(api_key)):
        if oauth_header is None:
            return None
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/base/OptionalTest.java

        assertThat(Optional.presentInstances(optionals)).isEmpty();
      }
    
      public void testPresentInstances_somePresent() {
        List<Optional<String>> optionals =
            ImmutableList.of(Optional.of("a"), Optional.<String>absent(), Optional.of("c"));
        assertThat(Optional.presentInstances(optionals)).containsExactly("a", "c").inOrder();
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Feb 21 18:32:41 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/base/OptionalTest.java

        assertThat(Optional.presentInstances(optionals)).isEmpty();
      }
    
      public void testPresentInstances_somePresent() {
        List<Optional<String>> optionals =
            ImmutableList.of(Optional.of("a"), Optional.<String>absent(), Optional.of("c"));
        assertThat(Optional.presentInstances(optionals)).containsExactly("a", "c").inOrder();
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 18:32:41 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  7. common-protos/k8s.io/api/apps/v1beta1/generated.proto

    message Deployment {
      // Standard object metadata.
      // +optional
      optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
    
      // Specification of the desired behavior of the Deployment.
      // +optional
      optional DeploymentSpec spec = 2;
    
      // Most recently observed status of the Deployment.
      // +optional
      optional DeploymentStatus status = 3;
    }
    
    Plain Text
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Mon Mar 11 18:43:24 GMT 2024
    - 24K bytes
    - Viewed (0)
  8. common-protos/k8s.io/api/autoscaling/v1/generated.proto

      // one status to another
      // +optional
      optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
    
      // reason is the reason for the condition's last transition.
      // +optional
      optional string reason = 4;
    
      // message is a human-readable explanation containing details about
      // the transition
      // +optional
      optional string message = 5;
    }
    
    Plain Text
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Mon Mar 11 18:43:24 GMT 2024
    - 22K bytes
    - Viewed (0)
  9. common-protos/k8s.io/api/autoscaling/v2/generated.proto

      // +optional
      optional string reason = 4;
    
      // message is a human-readable explanation containing details about
      // the transition
      // +optional
      optional string message = 5;
    }
    
    // HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
    message HorizontalPodAutoscalerList {
      // metadata is the standard list metadata.
      // +optional
    Plain Text
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Mon Mar 11 18:43:24 GMT 2024
    - 21.3K bytes
    - Viewed (0)
  10. common-protos/k8s.io/api/policy/v1beta1/generated.proto

      // +optional
      optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
    
      // Specification of the desired behavior of the PodDisruptionBudget.
      // +optional
      optional PodDisruptionBudgetSpec spec = 2;
    
      // Most recently observed status of the PodDisruptionBudget.
      // +optional
      optional PodDisruptionBudgetStatus status = 3;
    }
    
    Plain Text
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Mon Mar 11 18:43:24 GMT 2024
    - 19.6K bytes
    - Viewed (0)
Back to top