Question: According to [this guide](https://learn.microsoft.com/en-us/graph/sdks/choose-authentication-providers?tabs=CS#usernamepassword-provider) there are a jillion ways to integrate, some of which are beyond my understanding, but they seem to require a Client Id which is created via portal.azure.com

When I log into that site, it says I don't have a subscription. I don't really want an azure subscription - I have an office 365 subscription already.

Is there a way to integrate with office 365 without an azure subscription or some way that means I don't have to pay for Azure?

I have a program that runs as a windows service that books something, and when it's completed I simply wanted to insert the booking automatically into my outlook calendar.

Answer: 
> 
> Are there any better alternatives?
> 
> 
> 

If you have variable which can have limited number of values then it might be represented using [`enum`](https://docs.python.org/3/library/enum.html). You need powe to dictate what type of argument your function is accepting in order to use this approach.

> 
> It is not impossible that the value check of my\_var that happens on a
> different place changes over time, which would make this code to be
> potentially wrong as it will handle any new values using the else part
> of the conditional.
> 
> 
> 

You need to **unrevokably** decide who is responsible for checking that (where check should be). Repeating exactly *same* check might be considered infringement of DRY rule.
As you said the function that calls your `my_func` can change over time and start passing different values.

What you could do additionally in your code is to add `Literal` typing for your parameter

```py
from typing import Literal

def my_func(my_var: Literal['val1', 'val2']) -> str:
    if my_var == 'val1':
        return '1'
    elif my_var == 'val2':
        return '2'
    else:
        raise ValueError('Unsupported value')

```

That way developers will have highlighted code if they will try to call your function with different parameter:

[![enter image description here](https://i.stack.imgur.com/Em1Ea.png)](https://i.stack.imgur.com/Em1Ea.png)