Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5fe6592
Initial commit for farmbeats client
agniveshadhikari Mar 11, 2021
3ee382b
Added placeholder readme for azure-farmbeats-ds
agniveshadhikari Mar 11, 2021
486f9a6
Updated swagger, autogen code.
agniveshadhikari Mar 12, 2021
b3dfdd6
restructuring
agniveshadhikari Mar 15, 2021
7145caf
Add ci.yml
agniveshadhikari Mar 15, 2021
7c9d862
Adding readmes, should fix readme validation issue
agniveshadhikari Mar 18, 2021
feaba8b
Bumping a header to h2 to hopefully resolve readme check
agniveshadhikari Mar 21, 2021
732780c
Deleting top level readme
agniveshadhikari Mar 21, 2021
777a82a
Specifying dep versions in setup.py
agniveshadhikari Mar 21, 2021
e76be9a
Removing wrapper
agniveshadhikari Mar 29, 2021
8ac675f
LROs should be sorted now
agniveshadhikari Mar 29, 2021
8d74a58
autorest level rename of client
agniveshadhikari Mar 30, 2021
f5a094e
March Swagger updates (not final)
agniveshadhikari Apr 15, 2021
b0994d5
Intermediate checking, LROs probably work
agniveshadhikari Apr 20, 2021
65d7b0f
Manually updated swagger
agniveshadhikari Apr 20, 2021
b3f9b3e
Adding msrest to deps for package
agniveshadhikari Apr 22, 2021
ef1f724
Updates, added an example script for now.
agniveshadhikari May 6, 2021
1491922
Adding a helper script to wrap the generation command
agniveshadhikari May 10, 2021
4ad9af5
deleting the ds dir
agniveshadhikari May 10, 2021
e41f714
Added final version info to setup
agniveshadhikari May 10, 2021
0c205ae
Generated client form latest swagger. This breaks base url. Yet to ma…
agniveshadhikari May 10, 2021
95cf84d
Added default scope
agniveshadhikari May 11, 2021
b344a8a
Adding back baseurl manually
agniveshadhikari May 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions sdk/farmbeats/azure-farmbeats-ds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Azure Farnbeats API DS client library for Python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not be here


TODO

## Getting started

## Key concepts

### Prerequisites

* Azure subscription
* Azure Farmbeats instance
* Python 2.7 or 3.5.3+ TODO figure out supported versions

If you need a Cosmos DB SQL API account, you can follow this link TODO

### Install the package

+ Install GDAL: TODO

```bash
pip install azure-farmbeats
```

#### Configure a virtual environment (optional)

Although not required, you can keep your base system and Azure SDK environments isolated from one another if you use a virtual environment. Execute the following commands to configure and then enter a virtual environment with venv:

```Bash
python3 -m venv farmbeats-test-env
source farmbeats-test-env/bin/activate
```
### Authenticate the client

TODO

### Create the client

TODO

## Examples

Here are some common use case scenarios:

TODO

## Troubleshooting

TODO


## Next steps

TODO

<!-- LINKS -->
[azure_cli]: https://docs.microsoft.com/cli/azure

## Contributing

This project welcomes contributions and suggestions.
Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that
you have the right to, and actually do, grant us
the rights to use your contribution.

For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will
automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment).
Simply follow the instructions provided by the bot.
You will only need to do this once across all repos using our CLA.

This project has adopted the
[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected])
with any additional questions or comments.
78 changes: 78 additions & 0 deletions sdk/farmbeats/azure-farmbeats/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Azure Farnbeats API client library for Python

TODO

## Getting started

### Key concepts

### Prerequisites

* Azure subscription
* Azure Farmbeats instance
* Python 2.7 or 3.5.3+ TODO figure out supported versions

If you need a Cosmos DB SQL API account, you can follow this link TODO

### Install the package

```bash
pip install azure-farmbeats
```

#### Configure a virtual environment (optional)

Although not required, you can keep your base system and Azure SDK environments isolated from one another if you use a virtual environment. Execute the following commands to configure and then enter a virtual environment with venv:

```Bash
python3 -m venv farmbeats-test-env
source farmbeats-test-env/bin/activate
```
### Authenticate the client

TODO

### Create the client

TODO

## Examples

Here are some common use case scenarios:

TODO

## Troubleshooting

TODO


## Next steps

TODO

<!-- LINKS -->
[azure_cli]: https://docs.microsoft.com/cli/azure

## Contributing

This project welcomes contributions and suggestions.
Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that
you have the right to, and actually do, grant us
the rights to use your contribution.

For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will
automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment).
Simply follow the instructions provided by the bot.
You will only need to do this once across all repos using our CLA.

This project has adopted the
[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected])
with any additional questions or comments.
1 change: 1 addition & 0 deletions sdk/farmbeats/azure-farmbeats/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions sdk/farmbeats/azure-farmbeats/azure/farmbeats/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .farmbeatsclient import FarmbeatsClient
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._azure_ag_food_platform_data_plane_service import AzureAgFoodPlatformDataPlaneService
__all__ = ['AzureAgFoodPlatformDataPlaneService']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.core import PipelineClient
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import AzureAgFoodPlatformDataPlaneServiceConfiguration
from .operations import AzureAgFoodPlatformDataPlaneServiceOperationsMixin
from . import models


class AzureAgFoodPlatformDataPlaneService(AzureAgFoodPlatformDataPlaneServiceOperationsMixin):
"""APIs documentation for Azure AgPlatform DataPlane Service.

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param str base_url: Service URL
"""

def __init__(
self,
credential, # type: "TokenCredential"
base_url=None,
**kwargs # type: Any
):
# type: (...) -> None
self._config = AzureAgFoodPlatformDataPlaneServiceConfiguration(credential, **kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)


def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
http_request.url = self._client.format_url(http_request.url)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()

def __enter__(self):
# type: () -> AzureAgFoodPlatformDataPlaneService
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential

VERSION = "unknown"

class AzureAgFoodPlatformDataPlaneServiceConfiguration(Configuration):
"""Configuration for AzureAgFoodPlatformDataPlaneService.

Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
"""

def __init__(
self,
credential, # type: "TokenCredential"
**kwargs # type: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
super(AzureAgFoodPlatformDataPlaneServiceConfiguration, self).__init__(**kwargs)

self.credential = credential
self.api_version = "2020-12-31-preview"
self.credential_scopes = kwargs.pop('credential_scopes', [])
kwargs.setdefault('sdk_moniker', 'azureagfoodplatformdataplaneservice/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if not self.credential_scopes and not self.authentication_policy:
raise ValueError("You must provide either credential_scopes or authentication_policy as kwargs")
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._azure_ag_food_platform_data_plane_service import AzureAgFoodPlatformDataPlaneService
__all__ = ['AzureAgFoodPlatformDataPlaneService']
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.1.3, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING

from azure.core import AsyncPipelineClient
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from msrest import Deserializer, Serializer

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import AzureAgFoodPlatformDataPlaneServiceConfiguration
from .operations import AzureAgFoodPlatformDataPlaneServiceOperationsMixin
from .. import models


class AzureAgFoodPlatformDataPlaneService(AzureAgFoodPlatformDataPlaneServiceOperationsMixin):
"""APIs documentation for Azure AgPlatform DataPlane Service.

:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param str base_url: Service URL
"""

def __init__(
self,
credential: "AsyncTokenCredential",
**kwargs: Any
) -> None:
base_url = 'None'
self._config = AzureAgFoodPlatformDataPlaneServiceConfiguration(credential, **kwargs)
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)


async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
http_request.url = self._client.format_url(http_request.url)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "AzureAgFoodPlatformDataPlaneService":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
await self._client.__aexit__(*exc_details)
Loading